[-] 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:
+7
-3
@@ -1164,12 +1164,16 @@ class ProductCore extends ObjectModel
|
|||||||
*/
|
*/
|
||||||
public function addSupplierReference($id_supplier, $id_product_attribute, $supplier_reference = null, $price = null, $id_currency = null)
|
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
|
//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
|
//create new record
|
||||||
$product_supplier_entity = new ProductSupplier();
|
$product_supplier_entity = new ProductSupplier();
|
||||||
|
|||||||
Reference in New Issue
Block a user