// OrderHistory: fixed synchronize/updateQuantity conflits

This commit is contained in:
bMancone
2011-12-12 15:39:48 +00:00
parent 5e5acfc3b7
commit f6a6177e2a
+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);
}
}