Answer the question
In order to leave comments, you need to log in
How to update the number of items in the cart without reloading?
Hello! There is a standard online store on wordpress + woocommerce in which on the basket page
you can increase or decrease the quantity of goods with pluses / minuses, but the cost is updated only after clicking the update button. How to make the update work using ajax technology without reloading the page and without the refresh button?
There is a woocommerce ajax cart plugin , but it doesn't work with the latest versions of wordpress and woocommerce.
I'm trying to bind the value of the input field to change the value and bind it to one of the triggers, but the info is not saved when you go to the design page
$('.cart_item .input-text.qty.text').change(function () {
this.setAttribute('value',$(this).val());
//$( document.body ).trigger( 'update_checkout' );
//$( document.body ).trigger( 'updated_cart_totals' );
$( document.body ).trigger( 'updated_wc_div' );
});
Answer the question
In order to leave comments, you need to log in
Do you have any triggers hanging, do they lead somewhere? As is often the case in this kind of crafts - everything is implemented through the back seat. It would be nice if the Indians wrote, but it seems that normal people write.
Specifically, according to your example - something like
$('.elem.plus').click (function () {
$.post ('ajax.php', { 'action':'cart', 'area':'plus' }, function (result) {
$('.total').html (result);
});
});
<div class="elem plus"></div>
http://
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question