Post by Jackcohen » Thu Dec 01, 2011 3:57 am

Okay 2 concerns here.

1. I'd like to remove the add to cart button from category pages, and only be visible at the product page.
2. Making a custom checkout button just for product page (If you can give me like a test CSS code with a temp display buttom)

Active Member

Posts

Joined
Sun Aug 07, 2011 1:08 pm

Post by uksitebuilder » Thu Dec 01, 2011 6:19 pm

1. edit the catalog/view/theme/default/template/product/category.tpl file and remove the code for the button

in 1.5.1.3 it is

Code: Select all

<div class="cart"><a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a></div>
2. Please answer these few questions

do you want to retain the add to cart button and have a checkout button next to it ?
or do you want to replace the add to cart button with a checkout button ?

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by Jackcohen » Fri Dec 02, 2011 3:31 am

Thanks, I want a whole new button for the checkout like a Place Order button

Active Member

Posts

Joined
Sun Aug 07, 2011 1:08 pm

Post by uksitebuilder » Sat Dec 03, 2011 6:04 pm

edit: catalog/language/yourlanguage/product/product.php

add a new define

Code: Select all

$_['button_place_order']       = 'Place Order';
edit: catalog/controller/product/product.php

find

Code: Select all

			$this->data['button_cart'] = $this->language->get('button_cart');
add before

Code: Select all

			$this->data['button_place_order'] = $this->language->get('button_place_order');
edit: catalog/view/theme/yourtheme/template/product/product.tpl

find 2 x occurrences of

Code: Select all

$button_cart
change both occurrences to

Code: Select all

$button_place_order
find

Code: Select all

				$('.success').fadeIn('slow');
					
				$('#cart_total').html(json['total']);
				
				$('html, body').animate({ scrollTop: 0 }, 'slow'); 
change to

Code: Select all

				location.href = 'index.php?route=checkout/checkout';
edit: catalog/view/javascript/common.js

find

Code: Select all

				$('.success').fadeIn('slow');
				
				$('#cart_total').html(json['total']);
				
				$('html, body').animate({ scrollTop: 0 }, 'slow'); 
change to

Code: Select all

				location.href = 'index.php?route=checkout/checkout';

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by lemonie » Fri Dec 16, 2011 8:51 am

[quote="uksitebuilder"]1. edit the catalog/view/theme/default/template/product/category.tpl file and remove the code for the button

in 1.5.1.3 it is

Code: Select all

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

I've tried this but I just get 'null' where the button was ?

www.lemoniedesigns.co.uk

thanks

New member

Posts

Joined
Fri Nov 18, 2011 8:28 pm

Post by uksitebuilder » Fri Dec 16, 2011 5:38 pm

You will also need to remove the following from the javascript section at the bottom of the page

Code: Select all

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

Code: Select all

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

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by lemonie » Fri Dec 16, 2011 7:40 pm

Thank you once again.

The help on this forum is the reason that I deleted Prestashop and installed Opencart.

New member

Posts

Joined
Fri Nov 18, 2011 8:28 pm
Who is online

Users browsing this forum: No registered users and 364 guests