Jump to content

Ajax add to cart error


nhocleopro

Recommended Posts

Hello every body !

I custom product-list.tpl to mutil add product to cart.

my site:

But the first time I add multi products, I get an error and I just can add only one product to cart

Then, i reload the page or continue add mutil products. It works well

This is my code:

$('.add_all').unbind('click').click(function(){
  $("li#ecs-list-product").each(function(index){
  if(parseInt($('#my_qty_id'+$(this).attr('rel')).val()) > 0){
my_qty = parseInt($('#my_qty_id'+$(this).attr('rel')).val());
  var idProduct =  $(this).attr('rel').replace('nofollow', '').replace('ajax_id_product_', '');
  if ($(this).attr('disabled') != 'disabled')
ajaxCart.add(idProduct, null, true, this,my_qty);
$('#my_qty_id'+$(this).attr('rel')).val('');
}
  });
  return false;
 });

Who can help me fix this error?

Thanks !!!!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...