// Assigned compared products to smarty
This commit is contained in:
@@ -1543,7 +1543,7 @@ class AdminControllerCore extends Controller
|
|||||||
'link' => $this->context->link,
|
'link' => $this->context->link,
|
||||||
'shop_name' => Configuration::get('PS_SHOP_NAME'),
|
'shop_name' => Configuration::get('PS_SHOP_NAME'),
|
||||||
'base_url' => $this->context->shop->getBaseURL(),
|
'base_url' => $this->context->shop->getBaseURL(),
|
||||||
'tab' => $tab, // Deprecated, this tab is declared in the foreach, so it's the last tab in the foreach
|
'tab' => isset($tab) ? $tab : null, // Deprecated, this tab is declared in the foreach, so it's the last tab in the foreach
|
||||||
'current_parent_id' => (int)Tab::getCurrentParentId(),
|
'current_parent_id' => (int)Tab::getCurrentParentId(),
|
||||||
'tabs' => $tabs,
|
'tabs' => $tabs,
|
||||||
'install_dir_exists' => file_exists(_PS_ADMIN_DIR_.'/../install'),
|
'install_dir_exists' => file_exists(_PS_ADMIN_DIR_.'/../install'),
|
||||||
|
|||||||
@@ -304,6 +304,10 @@ class FrontControllerCore extends Controller
|
|||||||
foreach ($languages as $lang)
|
foreach ($languages as $lang)
|
||||||
$meta_language[] = $lang['iso_code'];
|
$meta_language[] = $lang['iso_code'];
|
||||||
|
|
||||||
|
$compared_products = array();
|
||||||
|
if (Configuration::get('PS_COMPARATOR_MAX_ITEM') && isset($this->context->cookie->id_compare))
|
||||||
|
$compared_products = CompareProduct::getCompareProducts($this->context->cookie->id_compare);
|
||||||
|
|
||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
// Usefull for layout.tpl
|
// Usefull for layout.tpl
|
||||||
'mobile_device' => $this->context->getMobileDevice(),
|
'mobile_device' => $this->context->getMobileDevice(),
|
||||||
@@ -342,6 +346,7 @@ class FrontControllerCore extends Controller
|
|||||||
'PS_STOCK_MANAGEMENT' => Configuration::get('PS_STOCK_MANAGEMENT'),
|
'PS_STOCK_MANAGEMENT' => Configuration::get('PS_STOCK_MANAGEMENT'),
|
||||||
'quick_view' => Configuration::get('PS_QUICK_VIEW'),
|
'quick_view' => Configuration::get('PS_QUICK_VIEW'),
|
||||||
'shop_phone' => Configuration::get('PS_SHOP_PHONE'),
|
'shop_phone' => Configuration::get('PS_SHOP_PHONE'),
|
||||||
|
'compared_products' => is_array($compared_products) ? $compared_products : array()
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add the tpl files directory for mobile
|
// Add the tpl files directory for mobile
|
||||||
|
|||||||
@@ -84,17 +84,16 @@ class CompareControllerCore extends FrontController
|
|||||||
$hasProduct = false;
|
$hasProduct = false;
|
||||||
|
|
||||||
if (!Configuration::get('PS_COMPARATOR_MAX_ITEM'))
|
if (!Configuration::get('PS_COMPARATOR_MAX_ITEM'))
|
||||||
return Tools::redirect('index.php?controller=404');
|
return Tools::redirect('index.php?controller=404');
|
||||||
|
|
||||||
|
$ids = null;
|
||||||
if (($product_list = Tools::getValue('compare_product_list')) && ($postProducts = (isset($product_list) ? rtrim($product_list, '|') : '')))
|
if (($product_list = Tools::getValue('compare_product_list')) && ($postProducts = (isset($product_list) ? rtrim($product_list, '|') : '')))
|
||||||
$ids = array_unique(explode('|', $postProducts));
|
$ids = array_unique(explode('|', $postProducts));
|
||||||
else if (isset($this->context->cookie->id_compare))
|
elseif (isset($this->context->cookie->id_compare))
|
||||||
{
|
{
|
||||||
$ids = CompareProduct::getCompareProducts($this->context->cookie->id_compare);
|
$ids = CompareProduct::getCompareProducts($this->context->cookie->id_compare);
|
||||||
Tools::redirect($this->context->link->getPageLink('products-comparison', null, $this->context->language->id, array('compare_product_list' => implode('|', $ids))));
|
Tools::redirect($this->context->link->getPageLink('products-comparison', null, $this->context->language->id, array('compare_product_list' => implode('|', $ids))));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$ids = null;
|
|
||||||
|
|
||||||
if ($ids)
|
if ($ids)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3167,7 +3167,6 @@ class BlockLayered extends Module
|
|||||||
|
|
||||||
$smarty->assign($filter_block);
|
$smarty->assign($filter_block);
|
||||||
$smarty->assign('hide_0_values', Configuration::get('PS_LAYERED_HIDE_0_VALUES'));
|
$smarty->assign('hide_0_values', Configuration::get('PS_LAYERED_HIDE_0_VALUES'));
|
||||||
|
|
||||||
return $this->display(__FILE__, 'blocklayered.tpl');
|
return $this->display(__FILE__, 'blocklayered.tpl');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user