View Single Post
  #4  
Old 05-30-2014, 02:37 PM
Maya's Avatar
Maya Maya is offline
Ecwid Team
 
Join Date: Feb 2010
Location: Ecwid headquarter
Posts: 5,876
Default

Hello,

You'd better to change your store URL hash to redirect customer to cart page, where "Add to cart" button is clicked. Use following code:
Code:
window.location.hash = "#!/~/cart";
Thus, you will get following code:
Code:
$('.add-to-cart').click(function() {
	var id_product = $(this).data('single-product-id');
	Ecwid.Cart.addProduct({
		id: id_product,
		callback: function(success, product, cart){
			console.log(success); // true or false
			console.log(product.name);
                        window.location.hash = "#!/~/cart";
		}
	});
});
Good luck!
__________________
Maya N., Ecwid Team

------------------
Welcome to our new Help Center!
The Following User Says Thank You to Maya For This Useful Post:
Luminette Lucimed (05-30-2014)