[*] Classes: Db->execute() now return always a boolean. Use Db->query() instead.
This commit is contained in:
@@ -666,17 +666,17 @@ abstract class Module
|
||||
if (!isset(self::$_hookModulesCache))
|
||||
{
|
||||
$db = Db::getInstance(_PS_USE_SQL_SLAVE_);
|
||||
$result = $db->executeS('
|
||||
$results = $db->executeS('
|
||||
SELECT h.`name` as hook, m.`id_module`, h.`id_hook`, m.`name` as module, h.`live_edit`
|
||||
FROM `'._DB_PREFIX_.'module` m
|
||||
LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module`
|
||||
LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook`
|
||||
AND m.`active` = 1
|
||||
ORDER BY hm.`position`', false);
|
||||
ORDER BY hm.`position`');
|
||||
self::$_hookModulesCache = array();
|
||||
|
||||
if ($result)
|
||||
while ($row = $db->nextRow())
|
||||
if ($results)
|
||||
foreach ($results as $row)
|
||||
{
|
||||
$row['hook'] = strtolower($row['hook']);
|
||||
if (!isset(self::$_hookModulesCache[$row['hook']]))
|
||||
|
||||
@@ -32,10 +32,8 @@ function convert_product_price()
|
||||
$taxRates = array();
|
||||
foreach ($taxes as $data)
|
||||
$taxRates[$data['id_tax']] = (float)($data['rate']) / 100;
|
||||
$resource = DB::getInstance()->executeS('SELECT `id_product`, `price`, `id_tax` FROM `'._DB_PREFIX_.'product`', false);
|
||||
if (!$resource)
|
||||
die(Db::getInstance()->getMsgError());
|
||||
while ($row = DB::getInstance()->nextRow($resource))
|
||||
$results = DB::getInstance()->executeS('SELECT `id_product`, `price`, `id_tax` FROM `'._DB_PREFIX_.'product`');
|
||||
foreach ($results as $row)
|
||||
if ($row['id_tax'])
|
||||
{
|
||||
$price = $row['price'] * (1 + $taxRates[$row['id_tax']]);
|
||||
|
||||
Reference in New Issue
Block a user