Post by frama » Fri Feb 10, 2012 4:47 pm

Hi,
i am new in opencart, but is a real online shopping solution. One thing i want to solve is to change from add to cart to view product in category view, featured and latest items. add to cart to be only in the product page.
Anyone has any idea how to do it?

Newbie

Posts

Joined
Wed Jan 25, 2012 6:11 pm

Post by Vytenis » Fri Feb 10, 2012 5:25 pm

you mean you want to remove button "add to cart"? If so - edit .tpl files and delete codes of buttons. You can find in your theme category those files. You need to edit (i might forget some files) latest, featured, manufacturer and category pages.

New member

Posts

Joined
Mon Aug 01, 2011 1:33 am

Post by VAHID » Sun Feb 12, 2012 7:02 am

OK big edit

for each of the following files

Image

FIND:

Code: Select all

<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a>
Replace With:

Code: Select all

<a href="<?php echo $product['href']; ?>" class="button"><span>view product</span></a>

User avatar
New member

Posts

Joined
Sat Oct 22, 2011 4:55 am

Post by Lisaweb » Tue Feb 21, 2012 8:28 am

I wasn't the one asking, but thank you soo much for posting this! (needed it for one of my category templates.)
VAHID wrote:OK big edit

for each of the following files

Image

FIND:

Code: Select all

<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a>
Replace With:

Code: Select all

<a href="<?php echo $product['href']; ?>" class="button"><span>view product</span></a>

Using OC v1.5.4.1 with Evisu Theme


User avatar
Active Member

Posts

Joined
Wed Dec 07, 2011 12:01 am

Post by cirrussky » Tue May 22, 2012 9:51 am

So, if i only wanted this changed in the category view then would only need to change the category.tpl file? Not really worried about changing it in the other areas.

New member

Posts

Joined
Tue Feb 28, 2012 3:30 pm

Post by solaris955 » Sat Oct 12, 2013 2:39 pm

Hi Vahid,

Thank you very much! This has helped me as all :).

Thanks again.

Newbie

Posts

Joined
Wed Oct 09, 2013 5:32 pm

Post by thbr02 » Sat Nov 23, 2013 5:07 am

You could also use this:
http://www.opencart.com/index.php?route ... n_id=10925

It would save you a lot of job.

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by marco81 » Sat Mar 04, 2017 2:41 am

for vesion 2.0.2

<button type="button" onclick="window.location.href='<?php echo $product['href']; ?>';"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>

Newbie

Posts

Joined
Thu Oct 13, 2016 2:17 am

Post by FMiguez » Fri Mar 15, 2019 9:52 pm

Hi,

Would you like to know if it is possible to make this change in Version 3.0.3.1 (Brazil 1.2.4)?

Newbie

Posts

Joined
Mon Jan 21, 2019 3:38 am
Who is online

Users browsing this forum: No registered users and 14 guests