• Resolved Jaswinder0091

    (@jaswinder0091)


    Is it possible to update the mini cart via ajax, on changing the quantity. I have seen, it does work on cart page with given code, but as Mini cart does not have – Update cart button, so this will not work there.

    add_action( 'wp_footer',function(){
       ?>
       <script>
           jQuery( document ).ready(function($) {
    
               $(document.body).on('change','input.wqpmb_input_text.input-text.qty.text',function(){
                let updateButton = $('button.button[name="update_cart"]');
                   setTimeout(function(){
                       updateButton.trigger('click');
                   },700);
               });
           });
       </script>
       <?php
       } );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ajax auto update in Mini cart’ is closed to new replies.