Post by ambervision » Wed Jun 22, 2011 12:11 am

Hi,

On every product there is an option add to wishlist, but I do not want this option.

See screenshot attached.

How can I remove this option?

Kind Regards,

Ambervision

Attachments

Add to wishlist option.png

Add to wishlist option.png (29.2 KiB) Viewed 47852 times


Newbie

Posts

Joined
Sun Jun 19, 2011 9:18 pm

Post by i2Paq » Wed Jun 22, 2011 12:16 am

Your need to edit your products.tpl

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by chokoret » Wed Jun 22, 2011 12:18 pm

I was gonna put up the same question...

I deleted this part from product/category.tpl

Code: Select all

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

and text "null" appears on the location where the 'add to wish list" was..

User avatar
New member

Posts

Joined
Thu Jun 09, 2011 1:26 am
Location - Los Angeles, CA

Post by Ichortwo » Fri Jun 24, 2011 6:25 pm

I had the same issue. But it's not as simple as the current responses. You need to look through several templates and the php files to fully disable wishlists.

I find it best to comment lines out rather than delete them. And make a back up of any file you're editing.

Wishlist appears in all these files:

\admin\controller\setting\setting.php (20 hits)
\admin\controller\setting\store.php (24 hits)
\admin\language\english\setting\setting.php (2 hits)
\admin\view\template\setting\setting.tpl (7 hits)
\admin\view\template\setting\store_form.tpl (7 hits)
\catalog\controller\account\account.php (4 hits)
\catalog\controller\account\wishlist.php (26 hits)
\catalog\controller\common\footer.php (4 hits)
\catalog\controller\common\header.php (6 hits)
\catalog\controller\module\account.php (4 hits)
\catalog\controller\product\category.php (2 hits)
\catalog\controller\product\manufacturer.php (2 hits)
\catalog\controller\product\product.php (2 hits)
\catalog\controller\product\search.php (2 hits)
\catalog\controller\product\special.php (2 hits)
\catalog\language\english\account\account.php (1 hits)
\catalog\language\english\account\wishlist.php (1 hits)
\catalog\language\english\common\footer.php (1 hits)
\catalog\language\english\common\header.php (1 hits)
\catalog\language\english\english.php (1 hits)
\catalog\language\english\module\account.php (1 hits)
\catalog\view\javascript\common.js (3 hits)
\catalog\view\theme\default\stylesheet\stylesheet.css (29 hits)
\catalog\view\theme\default\template\account\account.tpl (2 hits)
\catalog\view\theme\default\template\account\wishlist.tpl (3 hits)
\catalog\view\theme\default\template\common\footer.tpl (2 hits)
\catalog\view\theme\default\template\common\header.tpl (3 hits)
\catalog\view\theme\default\template\module\account.tpl (2 hits)
\catalog\view\theme\default\template\product\category.tpl (7 hits)
\catalog\view\theme\default\template\product\manufacturer_info.tpl (7 hits)
\catalog\view\theme\default\template\product\product.tpl (2 hits)
\catalog\view\theme\default\template\product\search.tpl (7 hits)
\catalog\view\theme\default\template\product\special.tpl (7 hits)
\install\opencart.sql (3 hits)
\system\library\customer.php (12 hits)

I would like to tell you how I dealt with it, but I've already heavily edited my templates so could easily point you the wrong direction.

This list is a strong argument IMHO for some on/off switches in the back end. (Same for breadcrumbs actually).

Good luck

Newbie

Posts

Joined
Sun Apr 24, 2011 12:30 am

Post by pthesis » Sun Jun 26, 2011 1:20 am

I would suggest you don't touch anything but the template files. There's a lower chance of breaking stuff that way, and it would be easier to revert in case you wanted to add the wishlist back.

I needed to remove it as well and it was enough to remove it from the template like one of the answers above mentions. You also need to remove it from inside the JavaScript functions in the template - that's why the poster above is seeing "null". I don't have access to the files right now otherwise I'd tell you exactly what you need to remove from your template.
Last edited by pthesis on Sun Jun 26, 2011 1:23 am, edited 1 time in total.

Newbie

Posts

Joined
Tue Jun 21, 2011 2:42 am

Post by peecha85 » Sun Jun 26, 2011 1:22 am

chokoret wrote:I was gonna put up the same question...

I deleted this part from product/category.tpl

Code: Select all

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

and text "null" appears on the location where the 'add to wish list" was..

this is where I commented out and add to wish list as well as null were gone:

Code: Select all

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

Active Member

Posts

Joined
Tue May 11, 2010 10:28 pm

Post by Tromas » Tue Jun 28, 2011 11:45 am

Remove these two lines in category.tpl:

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

and these two lines in product.tpl:

<div><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />
<a onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a></div>

+ remove from manufacturer_info.tpl:

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



It seems to work for me at least.

Anbefalt vibrator
Dildo i glass og metall
Myke sex leketøy i silikon


New member

Posts

Joined
Sat Feb 12, 2011 1:06 am


Post by hotwebideas » Thu Jul 07, 2011 12:10 am

This is great. I had the same issues as well. I also agree that we should not edit the PHP files. There is no reason to. The user only sees your Views anyway and keeping the PHP files intact is perfectly fine. If you edit the PHP files, you never know what you will break since other PHP code is relying and pointing to other code, especially in MVC frameworks.

Comment out the views only.

New member

Posts

Joined
Wed Jun 29, 2011 11:44 pm

Post by nyltak » Thu Aug 04, 2011 6:01 am

Don't forget to edit the Header and Footer tpls also, if only for aesthetics.

Tromas wrote:Remove these two lines in category.tpl:

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

and these two lines in product.tpl:

<div><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />
<a onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a></div>

+ remove from manufacturer_info.tpl:

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



It seems to work for me at least.

New member

Posts

Joined
Wed Jul 20, 2011 9:56 am

Post by mandamexico » Sun Aug 14, 2011 12:14 pm

Do Tromas' method so that it doesnt work and appear on any pages.
Then go to (/catalog/view/theme/default/template/common) and comment out from header.tpl and delete line from footer.tpl

Thanks Tromas, nyltak it works 100% fine for me. ;D

Cheers!

Christian

My Extensions

OpenCart Developer (OCD) Tools

Donate - If I ever helped you.


User avatar
Active Member

Posts

Joined
Mon Jun 29, 2009 10:14 am
Location - Los Angeles, CA

Post by fadhlul » Thu Feb 02, 2012 11:57 pm

You must edit 2 files under your template folder (catalog/view/theme/your template name/template/product/):

1. product.tpl
2. category.tpl

For both files, edit by commenting codes as follows:

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

Result: No wishlist nor Compare and yes, no more null error.

Got it working thru trial and error.

Newbie

Posts

Joined
Thu Jan 26, 2012 3:24 pm

Post by Mikas007 » Sun Aug 11, 2013 3:09 am

Here's a short tutorial how to do this simply and fast:

http://e-shopblog.com/opencart/how-to-r ... duct-page/

Newbie

Posts

Joined
Sun Jan 22, 2012 3:15 am

Post by butte » Sun Aug 11, 2013 5:55 am

Prestashop for that remedy, and "probably" (run it verbatim through engines) taken from old and recent OC forum threads in the first place?! (1) It specifically speaks to removing the offense "from the product page in OpenCart". That is high above in this thread, appears in scores of other prior threads, and seems not to satisfy folks above who wanted to launch editorial platoons and divisions on hapless dozes of files. (2) It specifically recommends simply <!--commenting out// --> the block that paints the offense. That is already long since on record in OC threads. Good grief.

Folks, the more files you edit, the more you'll need to PROOFREAD your changes, and you can set quite a few files at once into a competent ascii text editor in order to "change all files" at once for each change in the essentially identical blocks. Back 'em up first.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by socialevil » Fri Jan 03, 2014 5:40 am

Hello,
in order to remove wishlist and compare i just opened catalog/view/javascript/common.js and added
$(".wishlist").hide();
$(".compare").hide();

these two simple lines. This way, every time a page sees these two classes it will just hide them :)

Newbie

Posts

Joined
Sun Dec 01, 2013 11:44 am
Who is online

Users browsing this forum: No registered users and 13 guests