// Context part 2

This commit is contained in:
tDidierjean
2011-07-12 12:50:00 +00:00
parent 502942002d
commit 89920e17fd
21 changed files with 221 additions and 230 deletions
+4 -2
View File
@@ -273,8 +273,10 @@ class ManufacturerCore extends ObjectModel
return Tools::link_rewrite($this->name, false);
}
static public function getProducts($id_manufacturer, $id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, $getTotal = false, $active = true)
static public function getProducts($id_manufacturer, $id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, $getTotal = false, $active = true, $context = null)
{
if (!$context)
$context = Context::getContext();
if ($p < 1) $p = 1;
if (empty($orderBy) ||$orderBy == 'position') $orderBy = 'name';
if (empty($orderWay)) $orderWay = 'ASC';
@@ -311,7 +313,7 @@ class ManufacturerCore extends ObjectModel
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1)
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).')
LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group`
AND tr.`id_country` = '.(int)Country::getDefaultCountryId().'
AND tr.`id_country` = '.(int)$context->country->id.'
AND tr.`id_state` = 0)
LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`)
LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)($id_lang).')