[-] BO : fixed bug #PSCFV-3457

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16674 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vAugagneur
2012-08-03 07:55:45 +00:00
parent e8ad797150
commit 747cfd729b
+7 -3
View File
@@ -1164,12 +1164,16 @@ class ProductCore extends ObjectModel
*/
public function addSupplierReference($id_supplier, $id_product_attribute, $supplier_reference = null, $price = null, $id_currency = null)
{
//in some case we need to add price without supplier reference
if ($supplier_reference === null)
$supplier_reference = '';
//Try to set the default supplier reference
if ($id_supplier > 0 && $supplier_reference != null)
if ($id_supplier > 0)
{
$id_product_supplier = ProductSupplier::getIdByProductAndSupplier($this->id, $id_product_attribute, $id_supplier);
$id_product_supplier = (int)ProductSupplier::getIdByProductAndSupplier($this->id, $id_product_attribute, $id_supplier);
if (empty($id_product_supplier))
if (!$id_product_supplier)
{
//create new record
$product_supplier_entity = new ProductSupplier();