Здравствуйте.
Помогите пожалуйста разобраться: надо добавить сравнение товаров, как в категории товаров
Создавал override для вызова product-compare.js
<?php
class CartController extends CartControllerCore
{
public function setMedia()
{
parent::setMedia();
if (Configuration::get('PS_COMPARATOR_MAX_ITEM'))
$this->addJS(_THEME_JS_DIR_.'products-comparison.js');
}
public function initContent()
{
$this->context->smarty->assign('comparator_max_item', Configuration::get('PS_COMPARATOR_MAX_ITEM'));
if (isset($this->context->cookie->id_compare))
$this->context->smarty->assign('compareProducts', CompareProduct::getCompareProducts((int)$this->context->cookie->id_compare));
parent::initContent();
}
}
?>
И добавлял в shopping-cart-product-line.tpl
{if isset($comparator_max_item) && $comparator_max_item}
<p class="compare checkbox"><input type="checkbox" onclick="checkForComparison({$comparator_max_item})" class="comparator" id="comparator_item_{$product.id_product}" value="{$product.id_product}" /> <label for="comparator_item_{$product.id_product}">{l s='Select to compare'}</label></p>
{/if}
Ну и в shopping-cart.tpl кнопку
{include file="./product-compare.tpl"}
В итоге... Чекбокс не отображается т.к. не проходит проверку {if isset($comparator_max_item) && $comparator_max_item}
если убрать это условие, то чек бокс появится, но не определяется переменная $product.id_product
также вроде не подключается product-comparasion.js
Пожалуйста подскажите что не так или что делать надо, если все совсем не так...