From e6c523a2b1f109ab0154e803821bca4dce3ba912 Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Fri, 9 Dec 2011 13:09:32 +0000 Subject: [PATCH] // Stock decrementation --- classes/order/OrderHistory.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/order/OrderHistory.php b/classes/order/OrderHistory.php index f15698fa6..dbdc07049 100644 --- a/classes/order/OrderHistory.php +++ b/classes/order/OrderHistory.php @@ -87,7 +87,10 @@ class OrderHistoryCore extends ObjectModel { /* If becoming logable => adding sale */ if ($newOS->logable AND (!$oldOrderStatus OR !$oldOrderStatus->logable)) + { ProductSale::addProductSale($product['id_product'], $product['cart_quantity']); + StockAvailable::updateQuantity($product['id_product'], $product['id_product_attribute'], -(int)$product['cart_quantity']); + } /* If becoming unlogable => removing sale */ elseif (!$newOS->logable AND ($oldOrderStatus AND $oldOrderStatus->logable)) ProductSale::removeProductSale($product['id_product'], $product['cart_quantity']);