
05-30-2014, 02:37 PM
|
 |
Ecwid Team
|
|
Join Date: Feb 2010
Location: Ecwid headquarter
Posts: 5,876
|
|
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!
|