I need to implement Compare button as a link on product detail page.

What I trying to do:

<span><a class="btn-compare" onclick="popWin('<?php echo $_helper->getListUrl() ?>','compare','top:0,left:0,width=820,height=600,resizable=yes,scrollbars=yes')"><?php echo $this->__('Compare') ?></a><span>

Problem is $_helper->getListUrl() return strange link:

string 'my.dev/catalog/product_compare/index/uenc/aHR0cDovL2F0ZXguZGV2L2xpY2h0LWlua29vcC9iaW5uZW52ZXJsaWNodGluZy9wbGFmb25kLWluYm91dy90ZWtuaWx1eC03MzQ4NS5odG1s/' (length=160)

it's opening and closing in a second, there no products also.

Link must be my.dev/catalog/product_compate/index/.



Try replacing $_helper->getListUrl() with



And make sure you have products in the comparison list.

  • thanks for reply, it's showing and closing after second...
    – Stopper
    Dec 18 '13 at 14:15
  • Do you have any products added to the comparison list?
    – Marius
    Dec 18 '13 at 14:16
  • Yes, there set if($_helper->getItemCount() > 0): and I just add product on detail page and press link.
    – Stopper
    Dec 18 '13 at 14:22
  • I'm just update database, and it's working, probably was something with DB settings.
    – Stopper
    Dec 18 '13 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.