Search code examples
phpopencartopencart2.xopencart-moduleopencart2.3

Add to wishlist button on Category Page Opencart:2.3.0.2


I want to add a wishlist icon on Category page, like on the Product page.

<a onclick="wishlist.add('<?php echo $product_id; ?>');"><i class="icon-heart"></i> </a>

But this did not work in Category page. I also checked for jquery in product page with keyword "wishlist", but didn't find at all. So, where does this even is handled? And how can I implement it on Category Page?


Solution

  • Yes, Solved.

    When I change

    $product_id;
    

    to

    $product['product_id'];

    Then it has an ID(Like: wishlist.add(56)).