Answer the question
In order to leave comments, you need to log in
Is it possible to auto-update the cart when you click on + -?
How can I make the cart auto-update when you click on + - following the example of the site: delikateska .ru/product/6253?
Answer the question
In order to leave comments, you need to log in
it's just a cost-to-quantity conversion. Cart is not updated. For example
Like this. Put your classes there to make it work.
//Увеличить кол-во товаров на +1 из карточки
$(document).on("click", '.qty_plus', function() {
var $cur_val = $(this).closest('.qty_wrapper').find("input.qty").val();
$(this).closest('.qty_wrapper').find("input.qty").val( parseInt($cur_val) + 1 );
cart_update();
});
//Уменьшить кол-во товаров на -1 из карточки
$(document).on("click", '.qty_minus', function() {
console.log('-');
var $cur_val = $(this).closest('.qty_wrapper ').find("input.qty").val();
if($cur_val > 1) {
$(this).closest('.qty_wrapper').find("input.qty").val( parseInt($cur_val) - 1 );
cart_update();
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question