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 !!!!