[Support request] how to update cart automatically in WooCommerce cart page

Home Forums Support [Support request] how to update cart automatically in WooCommerce cart page

Home Forums Support how to update cart automatically in WooCommerce cart page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2366736
    xinghui

    how to update cart automatically in WooCommerce cart page when change product quantity.I added some code to make my product price change when the product quantity on my cart page changes, I added this code to my wp-footer hook but found it is not correct, please help I’ll check why, thanks
    This is the code I am adding:
    jQuery( function( $ ) {
    $(‘.woocommerce’).on(‘change’, ‘input.qty’, function(){
    $(“[name=’update_cart’]”).trigger(“click”);
    });
    } );
    Here is the link to the screenshot of the image displayed on my website after I added the code:https://i.postimg.cc/hjgVYrP0/cart-update.jpg

    #2367560
    David
    Staff
    Customer Support

    Hi there,

    remove the CSS you’re using to hide the Update Cart Button, then retry.

    #2367635
    xinghui

    Thank you David, after I deleted the CSS code, I re-added the update code, it showed the effect, I put the hidden update cart code in wp-footer and it also took effect, thank you very much

    #2367707
    David
    Staff
    Customer Support

    Glad to be of help!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.