// Manage SQL upgrade for stock management + bug fix

This commit is contained in:
dSevere
2011-12-13 11:09:37 +00:00
parent bbf33b9799
commit cd44e07056
6 changed files with 36 additions and 36 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
function set_stock_available()
{
//Get all products with positive quantity
$resource = Db::getInstance()->query('
$resource = Db::getInstance(_PS_USE_SQL_SLAVE_)->query('
SELECT quantity, id_product, out_of_stock
FROM `'._DB_PREFIX_.'product`
WHERE `active` = 1
@@ -13,7 +13,7 @@ function set_stock_available()
$quantity = 0;
//Try to get product attribues
$attributes = Db::getInstance()->ExecuteS('
$attributes = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT quantity, id_product_attribute
FROM `'._DB_PREFIX_.'product_attribute`
WHERE `id_product` = '.(int)$row['id_product']