// Context part 11
This commit is contained in:
@@ -93,8 +93,7 @@ class BlockViewed extends Module
|
||||
|
||||
function hookRightColumn($params)
|
||||
{
|
||||
global $link, $smarty, $cookie;
|
||||
|
||||
$context = Context::getContext();
|
||||
$id_product = (int)(Tools::getValue('id_product'));
|
||||
$productsViewed = (isset($params['cookie']->viewed) AND !empty($params['cookie']->viewed)) ? array_slice(explode(',', $params['cookie']->viewed), 0, Configuration::get('PRODUCTS_VIEWED_NBR')) : array();
|
||||
|
||||
@@ -154,7 +153,7 @@ class BlockViewed extends Module
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = cp.`id_category`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer_group` cug ON (cug.`id_group` = cg.`id_group`)
|
||||
WHERE p.`id_product` = '.(int)($id_product).'
|
||||
'.($cookie->id_customer ? 'AND cug.`id_customer` = '.(int)($cookie->id_customer) :
|
||||
'.($context->customer->id ? 'AND cug.`id_customer` = '.(int)$context->customer->id :
|
||||
'AND cg.`id_group` = 1')
|
||||
);
|
||||
if ($result['total'])
|
||||
@@ -168,7 +167,7 @@ class BlockViewed extends Module
|
||||
if (!sizeof($productsViewedObj))
|
||||
return ;
|
||||
|
||||
$smarty->assign(array(
|
||||
$context->controller->smarty->assign(array(
|
||||
'productsViewedObj' => $productsViewedObj,
|
||||
'mediumSize' => Image::getSize('medium')));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user