6

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/.

Thanks.

1 Answer 1

8

Try replacing $_helper->getListUrl() with

$this->getUrl('catalog/product_compare/index')

[EDIT]

And make sure you have products in the comparison list.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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