Jump to content

[SOLVED]Ajax add to cart button


Recommended Posts

Hello,

I have a problem with buy now/add to cart buttons. When I click on them the product image moves to cart and the item is added to cart but I need that clicking on that button (ajax_cart_button) it adds the item to cart and opens the cat summary page.

At the moment I'm using code:

 


jQuery(function($) {
$(".ajax_add_to_cart_button").click(function(e) {
setTimeout((function(){ window.location = "link/en/order"; }), 2000);
});
});

 

but it doesn't work. It looks like something in ajax-cart.js is disabling this script. If I write this part:

 


$(".ajax_add_to_cart_button").click(function(e) {
setTimeout((function(){ window.location = "link/en/order"; }), 2000);
});

 

in console and then click on button then everything works like expected.

Dose anyone know what could cause the code not to work?

 

PS version - 1.5.4

Theme - not default but ajax buttons haven't been edited.

Link to page - can't provide.

 

My aim is that add to cart button works like in this theme:

http://lt-demo.com/l...oduct&id_lang=1

Edited by R.Kinkeris (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...