[-] BO: Fix out of stock creation with multishop and stock sharing
This commit is contained in:
@@ -305,11 +305,7 @@ class StockAvailableCore extends ObjectModel
|
|||||||
if (!Validate::isUnsignedId($id_product))
|
if (!Validate::isUnsignedId($id_product))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ($id_shop === null)
|
|
||||||
$id_shop = Context::getContext()->shop->id;
|
|
||||||
|
|
||||||
$existing_id = StockAvailable::getStockAvailableIdByProductId((int)$id_product, (int)$id_product_attribute, (int)$id_shop);
|
$existing_id = StockAvailable::getStockAvailableIdByProductId((int)$id_product, (int)$id_product_attribute, (int)$id_shop);
|
||||||
|
|
||||||
if ($existing_id > 0)
|
if ($existing_id > 0)
|
||||||
{
|
{
|
||||||
Db::getInstance()->update(
|
Db::getInstance()->update(
|
||||||
|
|||||||
Reference in New Issue
Block a user