Home    Articles


How to remove Opencart wishlist and add to comapre links


In order to remove the wishlist and add to comapre links from particular page you need to locate the template first.
Let’s say that we want to remove the links from category page (the place where the products are displayed).

Go to catalog->view->theme->YOUR_THEME->template->product->category.tpl.
Find the lines:

<div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><?php echo $button_wishlist; ?></a></div>
<div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $button_compare; ?></a></div>

Now comment them with < !-- and -- >

This is not ready, becouse a null text is displayed. That’s becouse some javascript replace the content of these wishlist class.

Find the lines at the bottom of the page:

html += '<div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
html += '<div class="compare">' + $(element).find('.compare').html() + '</div>';

Now comment them with /* and */

That should be it for this page.