// When removing a product, its stock available is now properly removed

This commit is contained in:
bMancone
2011-11-14 16:21:44 +00:00
parent 8501ec1067
commit 2c2586544d
2 changed files with 24 additions and 0 deletions
+8
View File
@@ -601,6 +601,14 @@ class ProductCore extends ObjectModel
if ($real_quantity > $physical_quantity)
return false;
/**
* @since 1.5.0
* Removes the product from StockAvailable, for the current shop
*/
$context = Context::getContext();
$id_shop = $context->shop->id;
StockAvailable::removeProductFromStockAvailable($this->id, null, $id_shop);
if (!GroupReduction::deleteProductReduction($this->id))
return false;