//unlink carrier from product fix bug
This commit is contained in:
+2
-3
@@ -2198,14 +2198,13 @@ class ProductCore extends ObjectModel
|
|||||||
'id_shop' => (int)$this->id_shop
|
'id_shop' => (int)$this->id_shop
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Db::getInstance()->execute(
|
Db::getInstance()->execute(
|
||||||
'DELETE FROM `'._DB_PREFIX_.'product_carrier`
|
'DELETE FROM `'._DB_PREFIX_.'product_carrier`
|
||||||
WHERE id_product = '.(int)$this->id.'
|
WHERE id_product = '.(int)$this->id.'
|
||||||
AND id_shop = '.(int)$this->id_shop
|
AND id_shop = '.(int)$this->id_shop
|
||||||
);
|
);
|
||||||
|
if (count($data))
|
||||||
Db::getInstance()->insert('product_carrier', $data);
|
Db::getInstance()->insert('product_carrier', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3396,13 +3396,13 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
|
|
||||||
protected function addCarriers()
|
protected function addCarriers()
|
||||||
{
|
{
|
||||||
if (Tools::getValue('carriers'))
|
if (Validate::isLoadedObject($product = new Product((int)Tools::getValue('id_product'))))
|
||||||
{
|
{
|
||||||
if (Validate::isLoadedObject($product = new Product((int)Tools::getValue('id_product'))))
|
$carriers = array();
|
||||||
{
|
|
||||||
if (Tools::getValue('carriers'))
|
if (Tools::getValue('carriers'))
|
||||||
$product->setCarriers(Tools::getValue('carriers'));
|
$carriers = Tools::getValue('carriers');
|
||||||
}
|
$product->setCarriers($carriers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user