function makeVariant(attr1, attr2, attr3){
		let new_variant = {
			allow_out_of_stock              : 1,
			attr1_values					: $scope.product.attr1_values,
			attr2_values					: $scope.product.attr2_values,
			attr3_values					: $scope.product.attr3_values,
			attribute_value_1               : attr1,
			attribute_value_2               : attr2,
			attribute_value_3               : attr3,
			sku                             :'',
			retail_price                    : 0,
			before_discount_price           : 0,
			outlets 			: [...$scope.outlets.map(item => {
				item.retail_price = 0;
				item.supply_price = 0;
				return {...item}
			})],
			supplier_price                  : 0,
			editable                        : true,
			is_active                       : 1,
			is_deleted                      : 0,
			is_new                       	: 1,
			id                              :'',
		}
		return new_variant;
	}
/*simply create and return new variant object*/
simply create and return new variant object
simply create and return new variant object
function makeVariant(attr1, attr2, attr3){
		let new_variant = {
			allow_out_of_stock              : 1,
			attr1_values					: $scope.product.attr1_values,
			attr2_values					: $scope.product.attr2_values,
			attr3_values					: $scope.product.attr3_values,
			attribute_value_1               : attr1,
			attribute_value_2               : attr2,
			attribute_value_3               : attr3,
			sku                             :'',
			retail_price                    : 0,
			before_discount_price           : 0,
			outlets 			: [...$scope.outlets.map(item => {
				item.retail_price = 0;
				item.supply_price = 0;
				return {...item}
			})],
			supplier_price                  : 0,
			editable                        : true,
			is_active                       : 1,
			is_deleted                      : 0,
			is_new                       	: 1,
			id                              :'',
		}
		return new_variant;
	}
function makeVariant ( attr1 , attr2 , attr3 ) { let new_variant = { allow_out_of_stock : 1 , attr1_values : $scope . product . attr1_values , attr2_values : $scope . product . attr2_values , attr3_values : $scope . product . attr3_values , attribute_value_1 : attr1 , attribute_value_2 : attr2 , attribute_value_3 : attr3 , sku : '' , retail_price : 0 , before_discount_price : 0 , outlets : [ ... $scope . outlets . map ( item => { item . retail_price = 0 ; item . supply_price = 0 ; return { ... item } } ) ] , supplier_price : 0 , editable : true , is_active : 1 , is_deleted : 0 , is_new : 1 , id : '' , } return new_variant ; }
simply create and return new variant object
simply create and return new variant object