// Fix wholesaleprice when you import a combinaison CSV file
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15643 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+7
-7
@@ -1029,7 +1029,7 @@ class ProductCore extends ObjectModel
|
|||||||
* @deprecated since 1.5.0
|
* @deprecated since 1.5.0
|
||||||
*/
|
*/
|
||||||
public function addProductAttribute($price, $weight, $unit_impact, $ecotax, $quantity, $id_images, $reference,
|
public function addProductAttribute($price, $weight, $unit_impact, $ecotax, $quantity, $id_images, $reference,
|
||||||
$supplier_reference = null, $ean13, $default, $location = null, $upc = null, $minimal_quantity = 1)
|
$id_supplier = null, $ean13, $default, $location = null, $upc = null, $minimal_quantity = 1)
|
||||||
{
|
{
|
||||||
Tools::displayAsDeprecated();
|
Tools::displayAsDeprecated();
|
||||||
|
|
||||||
@@ -1043,7 +1043,7 @@ class ProductCore extends ObjectModel
|
|||||||
|
|
||||||
StockAvailable::setQuantity($this->id, $id_product_attribute, $quantity);
|
StockAvailable::setQuantity($this->id, $id_product_attribute, $quantity);
|
||||||
//Try to set the default supplier reference
|
//Try to set the default supplier reference
|
||||||
$this->addSupplierReference($supplier_reference, $id_product_attribute);
|
$this->addSupplierReference($id_supplier, $id_product_attribute);
|
||||||
return $id_product_attribute;
|
return $id_product_attribute;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1052,13 +1052,13 @@ class ProductCore extends ObjectModel
|
|||||||
* @param string $supplier_reference DEPRECATED
|
* @param string $supplier_reference DEPRECATED
|
||||||
*/
|
*/
|
||||||
public function addCombinationEntity($wholesale_price, $price, $weight, $unit_impact, $ecotax, $quantity,
|
public function addCombinationEntity($wholesale_price, $price, $weight, $unit_impact, $ecotax, $quantity,
|
||||||
$id_images, $reference, $supplier_reference, $ean13, $default, $location = null, $upc = null, $minimal_quantity = 1)
|
$id_images, $reference, $id_supplier, $ean13, $default, $location = null, $upc = null, $minimal_quantity = 1, array $id_shop_list = array())
|
||||||
{
|
{
|
||||||
$id_product_attribute = $this->addAttribute(
|
$id_product_attribute = $this->addAttribute(
|
||||||
$price, $weight, $unit_impact, $ecotax, $id_images,
|
$price, $weight, $unit_impact, $ecotax, $id_images,
|
||||||
$reference, $ean13, $default, $location, $upc, $minimal_quantity);
|
$reference, $ean13, $default, $location, $upc, $minimal_quantity, $id_shop_list);
|
||||||
|
|
||||||
$this->addSupplierReference($supplier_reference, $id_product_attribute);
|
$this->addSupplierReference($id_supplier, $id_product_attribute);
|
||||||
$result = ObjectModel::updateMultishopTable('Combination', array(
|
$result = ObjectModel::updateMultishopTable('Combination', array(
|
||||||
'wholesale_price' => (float)$wholesale_price,
|
'wholesale_price' => (float)$wholesale_price,
|
||||||
), 'a.id_product_attribute = '.(int)$id_product_attribute);
|
), 'a.id_product_attribute = '.(int)$id_product_attribute);
|
||||||
@@ -1127,7 +1127,7 @@ class ProductCore extends ObjectModel
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function updateProductAttribute($id_product_attribute, $wholesale_price, $price, $weight, $unit, $ecotax,
|
public function updateProductAttribute($id_product_attribute, $wholesale_price, $price, $weight, $unit, $ecotax,
|
||||||
$id_images, $reference, $supplier_reference = null, $ean13, $default, $location = null, $upc = null, $minimal_quantity, $available_date)
|
$id_images, $reference, $id_supplier = null, $ean13, $default, $location = null, $upc = null, $minimal_quantity, $available_date)
|
||||||
{
|
{
|
||||||
Tools::displayAsDeprecated();
|
Tools::displayAsDeprecated();
|
||||||
|
|
||||||
@@ -1135,7 +1135,7 @@ class ProductCore extends ObjectModel
|
|||||||
$id_product_attribute, $wholesale_price, $price, $weight, $unit, $ecotax,
|
$id_product_attribute, $wholesale_price, $price, $weight, $unit, $ecotax,
|
||||||
$id_images, $reference, $ean13, $default, $location = null, $upc = null, $minimal_quantity, $available_date
|
$id_images, $reference, $ean13, $default, $location = null, $upc = null, $minimal_quantity, $available_date
|
||||||
);
|
);
|
||||||
$this->addSupplierReference($supplier_reference, $id_product_attribute);
|
$this->addSupplierReference($id_supplier, $id_product_attribute);
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1596,20 +1596,23 @@ class AdminImportControllerCore extends AdminController
|
|||||||
// if no attribute reference is specified, creates a new one
|
// if no attribute reference is specified, creates a new one
|
||||||
if (!$id_product_attribute)
|
if (!$id_product_attribute)
|
||||||
{
|
{
|
||||||
$id_product_attribute = $product->addAttribute(
|
$id_product_attribute = $product->addCombinationEntity(
|
||||||
(float)$info['price'],
|
(float)$info['wholesale_price'],
|
||||||
(float)$info['weight'],
|
(float)$info['price'],
|
||||||
0,
|
(float)$info['weight'],
|
||||||
(float)$info['ecotax'],
|
0,
|
||||||
$id_image,
|
(float)$info['ecotax'],
|
||||||
strval($info['reference']),
|
(int)$info['quantity'],
|
||||||
strval($info['ean13']),
|
$id_image,
|
||||||
(int)$info['default_on'],
|
strval($info['reference']),
|
||||||
0,
|
0,
|
||||||
strval($info['upc']),
|
strval($info['ean13']),
|
||||||
(int)$info['minimal_quantity'],
|
(int)$info['default_on'],
|
||||||
$id_shop_list
|
0,
|
||||||
);
|
strval($info['upc']),
|
||||||
|
(int)$info['minimal_quantity'],
|
||||||
|
$id_shop_list
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// fills our attributes array, in order to add the attributes to the product_attribute afterwards
|
// fills our attributes array, in order to add the attributes to the product_attribute afterwards
|
||||||
|
|||||||
Reference in New Issue
Block a user