// no more _PS_USE_SQL_SLAVE_ in upgrade scripts
This commit is contained in:
@@ -186,7 +186,7 @@ function mo_getPriceDisplayMethod($id_group)
|
|||||||
static $cache;
|
static $cache;
|
||||||
|
|
||||||
if (!isset($cache[$id_group]))
|
if (!isset($cache[$id_group]))
|
||||||
$cache[$id_group] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
$cache[$id_group] = Db::getInstance()->getValue('
|
||||||
SELECT `price_display_method`
|
SELECT `price_display_method`
|
||||||
FROM `'._DB_PREFIX_.'group`
|
FROM `'._DB_PREFIX_.'group`
|
||||||
WHERE `id_group` = '.(int)$id_group);
|
WHERE `id_group` = '.(int)$id_group);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ function set_product_suppliers()
|
|||||||
FROM `'._DB_PREFIX_.'configuration` WHERE name="PS_CURRENCY_DEFAULT"');
|
FROM `'._DB_PREFIX_.'configuration` WHERE name="PS_CURRENCY_DEFAULT"');
|
||||||
|
|
||||||
//Get all products with positive quantity
|
//Get all products with positive quantity
|
||||||
$resource = Db::getInstance(_PS_USE_SQL_SLAVE_)->query('
|
$resource = Db::getInstance()->query('
|
||||||
SELECT id_supplier, id_product, supplier_reference, wholesale_price
|
SELECT id_supplier, id_product, supplier_reference, wholesale_price
|
||||||
FROM `'._DB_PREFIX_.'product`
|
FROM `'._DB_PREFIX_.'product`
|
||||||
WHERE `id_supplier` > 0
|
WHERE `id_supplier` > 0
|
||||||
@@ -26,7 +26,7 @@ function set_product_suppliers()
|
|||||||
');
|
');
|
||||||
|
|
||||||
//Try to get product attribues
|
//Try to get product attribues
|
||||||
$attributes = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
$attributes = Db::getInstance()->executeS('
|
||||||
SELECT id_product_attribute, supplier_reference, wholesale_price
|
SELECT id_product_attribute, supplier_reference, wholesale_price
|
||||||
FROM `'._DB_PREFIX_.'product_attribute`
|
FROM `'._DB_PREFIX_.'product_attribute`
|
||||||
WHERE `id_product` = '.(int)$row['id_product']
|
WHERE `id_product` = '.(int)$row['id_product']
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
function set_stock_available()
|
function set_stock_available()
|
||||||
{
|
{
|
||||||
//Get all products with positive quantity
|
//Get all products with positive quantity
|
||||||
$resource = Db::getInstance(_PS_USE_SQL_SLAVE_)->query('
|
$resource = Db::getInstance()->query('
|
||||||
SELECT quantity, id_product, out_of_stock
|
SELECT quantity, id_product, out_of_stock
|
||||||
FROM `'._DB_PREFIX_.'product`
|
FROM `'._DB_PREFIX_.'product`
|
||||||
WHERE `active` = 1
|
WHERE `active` = 1
|
||||||
@@ -13,7 +13,7 @@ function set_stock_available()
|
|||||||
$quantity = 0;
|
$quantity = 0;
|
||||||
|
|
||||||
//Try to get product attribues
|
//Try to get product attribues
|
||||||
$attributes = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
$attributes = Db::getInstance()->executeS('
|
||||||
SELECT quantity, id_product_attribute
|
SELECT quantity, id_product_attribute
|
||||||
FROM `'._DB_PREFIX_.'product_attribute`
|
FROM `'._DB_PREFIX_.'product_attribute`
|
||||||
WHERE `id_product` = '.(int)$row['id_product']
|
WHERE `id_product` = '.(int)$row['id_product']
|
||||||
@@ -48,4 +48,4 @@ function set_stock_available()
|
|||||||
("'.(int)$row['id_product'].'", "0", "1", "0", "'.(int)$quantity.'", "0", "'.(int)$row['out_of_stock'].'")
|
("'.(int)$row['id_product'].'", "0", "1", "0", "'.(int)$quantity.'", "0", "'.(int)$row['out_of_stock'].'")
|
||||||
');
|
');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ function update_order_canada()
|
|||||||
// returns Group::getDefaultPriceDisplayMethod
|
// returns Group::getDefaultPriceDisplayMethod
|
||||||
$tax_calculation_method = $order['price_display_method'];
|
$tax_calculation_method = $order['price_display_method'];
|
||||||
|
|
||||||
$products = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
$products = Db::getInstance()->ExecuteS('
|
||||||
SELECT * FROM `'._DB_PREFIX_.'order_detail` od
|
SELECT * FROM `'._DB_PREFIX_.'order_detail` od
|
||||||
WHERE od.`id_order` = '.(int)$id_order);
|
WHERE od.`id_order` = '.(int)$id_order);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ function update_stock_mvt_reason()
|
|||||||
{
|
{
|
||||||
//Get all stock mvts reasons already presents in the solution (from 1.4.x)
|
//Get all stock mvts reasons already presents in the solution (from 1.4.x)
|
||||||
//Remove standard movements to keep only custom movement
|
//Remove standard movements to keep only custom movement
|
||||||
$mvts = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
$mvts = Db::getInstance()->executeS('
|
||||||
SELECT smr.*
|
SELECT smr.*
|
||||||
FROM `'._DB_PREFIX_.'stock_mvt_reason`
|
FROM `'._DB_PREFIX_.'stock_mvt_reason`
|
||||||
WHERE `id` > 5
|
WHERE `id` > 5
|
||||||
@@ -12,7 +12,7 @@ function update_stock_mvt_reason()
|
|||||||
|
|
||||||
//Get all stock mvts reasons language traduction already presents in the solution (from 1.4.x)
|
//Get all stock mvts reasons language traduction already presents in the solution (from 1.4.x)
|
||||||
//Remove standard movements to keep only custom movement
|
//Remove standard movements to keep only custom movement
|
||||||
$mvts_lang = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
$mvts_lang = Db::getInstance()->executeS('
|
||||||
SELECT smrl.*
|
SELECT smrl.*
|
||||||
FROM `'._DB_PREFIX_.'stock_movement_reason_lang`
|
FROM `'._DB_PREFIX_.'stock_movement_reason_lang`
|
||||||
WHERE `id_stock_mvt_reason` > 5
|
WHERE `id_stock_mvt_reason` > 5
|
||||||
@@ -105,4 +105,4 @@ function update_stock_mvt_reason()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user