window.onload = function(){
$(document).ready(function(){
$('.clear_basket').on('click', function(){
var id = "";
var quntity = "";
var i = 0;
var num = $('.num_id');
(function func(){
var id = num.eq(i).val();
quntity = num.eq(i).closest('div.b_list').find('.b_quntity').val();
$.ajax({
url: "http://localhost/MyShop/php/product-basket-clear.php",
type:"POST",
data:{id:id, quntity:quntity},
success: function(result){
console.log(result);
if(num.length>++i) func();
}
});
console.log(id);
console.log(quntity);
})();
});
});
};