Post by unknownmale1 » Mon Oct 10, 2011 11:00 pm

I'm trying to build a very simple template, there are only 3 products so I want the add to cart button both from the category page and product page to add the product and go straight to the shopping cart...Is there a quick way around this?

Thank you in advance.

Active Member

Posts

Joined
Sat Aug 28, 2010 6:46 pm

Post by uksitebuilder » Mon Oct 10, 2011 11:20 pm

open: catalog/view/theme/default/template/product/product.tpl

find

Code: Select all

			if (json['success']) {
				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
					
				$('.success').fadeIn('slow');
					
				$('#cart_total').html(json['total']);
				
				$('html, body').animate({ scrollTop: 0 }, 'slow'); 
			}	
change to

Code: Select all

			if (json['success']) {
				location.href = 'index.php?route=checkout/cart'; 
			}	
open: catalog/view/javascript/common.js

find

Code: Select all

			if (json['success']) {
				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
				
				$('.success').fadeIn('slow');
				
				$('#cart_total').html(json['total']);
				
				$('html, body').animate({ scrollTop: 0 }, 'slow'); 
			}	
change to

Code: Select all

			if (json['success']) {
				location.href = 'index.php?route=checkout/cart'; 
			}	

User avatar
Guru Member

Posts

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

Post by unknownmale1 » Mon Oct 10, 2011 11:24 pm

Wow, Thank you so much that's perfect!

Active Member

Posts

Joined
Sat Aug 28, 2010 6:46 pm
Who is online

Users browsing this forum: No registered users and 4 guests