// OrderHistory: fixed synchronize/updateQuantity conflits

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11140 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
bMancone
2011-12-12 15:39:48 +00:00
parent 6f80da5b2b
commit 0a533f970f
+6 -1
View File
@@ -124,6 +124,7 @@ class OrderHistoryCore extends ObjectModel
{
$manager = StockManagerFactory::getManager();
$warehouse = new Warehouse($id_warehouse);
$depends =
$mvts = StockMvt::getNegativeStockMvts($order->id, $product['id_product'], $product['id_product_attribute'], $product['cart_quantity']);
foreach ($mvts as $mvt)
@@ -138,7 +139,11 @@ class OrderHistoryCore extends ObjectModel
true
);
}
StockAvailable::synchronize($product['id_product']);
if (StockAvailable::dependsOnStock($product['id_product'], $order->id_shop))
StockAvailable::synchronize($product['id_product']);
else
StockAvailable::updateQuantity($product['id_product'], $product['id_product_attribute'], (int)$product['cart_quantity'], $order->id_shop);
}
}