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

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10111 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
bMancone
2011-11-14 16:21:44 +00:00
parent 082d404597
commit 18e709aec4
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;