// Manage SQL upgrade for stock management + bug fix

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11168 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dSevere
2011-12-13 11:09:37 +00:00
parent 3c055ccf7a
commit 29ad584b5c
6 changed files with 36 additions and 36 deletions
+2 -5
View File
@@ -2,7 +2,7 @@
function set_product_suppliers()
{
//Get all products with positive quantity
$resource = Db::getInstance()->query('
$resource = Db::getInstance(_PS_USE_SQL_SLAVE_)->query('
SELECT id_supplier, id_product, supplier_reference, wholesale_price
FROM `'._DB_PREFIX_.'product`
WHERE `id_supplier` > 0
@@ -19,7 +19,7 @@ function set_product_suppliers()
');
//Try to get product attribues
$attributes = Db::getInstance()->ExecuteS('
$attributes = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT id_product_attribute, supplier_reference, wholesale_price
FROM `'._DB_PREFIX_.'product_attribute`
WHERE `id_product` = '.(int)$row['id_product']
@@ -28,9 +28,6 @@ function set_product_suppliers()
//Add each attribute to stock_available
foreach ($attributes as $attribute)
{
// add to global quantity
$quantity += $attribute['quantity'];
// set supplier for attribute
Db::getInstance()->execute('
INSERT INTO `'._DB_PREFIX_.'product_supplier`