From c6997bd52517c14b6e99a0a511c73bdebb17f8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 22 Oct 2013 11:09:55 +0200 Subject: [PATCH] // move clear cache of color list --- classes/stock/StockAvailable.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/classes/stock/StockAvailable.php b/classes/stock/StockAvailable.php index 85fd0bd79..62f6a0548 100644 --- a/classes/stock/StockAvailable.php +++ b/classes/stock/StockAvailable.php @@ -380,6 +380,21 @@ class StockAvailableCore extends ObjectModel return false; $result &= $this->postSave(); + return $result; + } + + /** + * Upgrades total_quantity_available after having saved + * @see StockAvailableCore::update() + * @see StockAvailableCore::add() + */ + public function postSave() + { + if ($this->id_product_attribute == 0) + return true; + + $id_shop = (Shop::getContext() != Shop::CONTEXT_GROUP ? $this->id_shop : null); + if (!Configuration::get('PS_DISP_UNAVAILABLE_ATTR')) { $combination = new Combination((int)$this->id_product_attribute); @@ -399,22 +414,7 @@ class StockAvailableCore extends ObjectModel } } } - } - return $result; - } - - /** - * Upgrades total_quantity_available after having saved - * @see StockAvailableCore::update() - * @see StockAvailableCore::add() - */ - public function postSave() - { - if ($this->id_product_attribute == 0) - return true; - - $id_shop = (Shop::getContext() != Shop::CONTEXT_GROUP ? $this->id_shop : null); $total_quantity = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT SUM(quantity) as quantity