В файле:
/modules/blockcategories/blockcategories.php найдите и замените следующий код:
Код:
if ((Tools::getValue('id_product') || Tools::getValue('id_category')) && isset($this->context->cookie->last_visited_category) && $this->context->cookie->last_visited_category)
{
$category = new Category($this->context->cookie->last_visited_category, $this->context->language->id);
if (Validate::isLoadedObject($category))
$this->smarty->assign(array('currentCategory' => $category, 'currentCategoryId' => $category->id));
}
на:
Код:
$currentCategoryId = 0;
if(Tools::getValue('id_product'))
$currentCategoryId = Db::getInstance()->getValue('SELECT product_shop.`id_category_default` FROM `'._DB_PREFIX_.'product` p '.Shop::addSqlAssociation('product', 'p').' WHERE p.`id_product` = '.(int)Tools::getValue('id_product'));
elseif(Tools::getValue('id_category'))
$currentCategoryId = Tools::getValue('id_category');
$category = new Category($this->context->cookie->last_visited_category, $this->context->language->id);
if (Validate::isLoadedObject($category))
$this->smarty->assign(array('currentCategory' => $category, 'currentCategoryId' => $currentCategoryId));
Код:
$cacheId = $this->getCacheId($category ? $category->id : null);
заменить на:
Код:
$cacheId = $this->getCacheId(Tools::getValue('id_category', 0) . '|' . Tools::getValue('id_product', 0) );
SMARTY-кеш вырастит к кол-ву товаров в ИМ.