// move clear cache of color list

This commit is contained in:
Rémi Gaillard committed 2013-10-22 11:09:55 +02:00
1 parent 96766a311e
commit c6997bd525
1 file changed
+15 -15
+15 -15
View File
@@ -380,6 +380,21 @@ class StockAvailableCore extends ObjectModel
return false; return false;
$result &= $this->postSave(); $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')) if (!Configuration::get('PS_DISP_UNAVAILABLE_ATTR'))
{ {
$combination = new Combination((int)$this->id_product_attribute); $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(' $total_quantity = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT SUM(quantity) as quantity SELECT SUM(quantity) as quantity