Auto-update cart when quantity changed - by Royalty

This topic has 7 replies, 2 voices, and was last updated 8 years, 1 months ago ago by Rose Tyler

  • Avatar: Royalty
    Royalty
    Participant
    April 20, 2017 at 17:18

    Hello,
    the following code works like a charm for Storefront theme in order to auto-update the cart when quantity changed:

    function cart_update_qty_script() {
      if (is_cart()) :
       ?>
        <script>
            jQuery('div.woocommerce').on('change', '.qty', function(){
               jQuery("[name='update_cart']").removeAttr('disabled');
               jQuery("[name='update_cart']").trigger("click"); 
            });
       </script>
    <?php
    endif;
    }
    add_action( 'wp_footer', 'cart_update_qty_script' );

    Unfortunately, the code doesnt work for Royal theme and I guess the reason is that Royal uses different classes. Could you please help me with modifying the code in order to use it with your theme?
    Many thanks in advance!

    6 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 21, 2017 at 12:51

    Hello,

    I’m sorry but additional customization is not included in our support. If you have any questions about additional customization you can contact WP-Kraken team.

    Regards,
    Rose Tyler.

    Avatar: Royalty
    Royalty
    Participant
    April 28, 2017 at 11:48

    Thats no additional customization, I am only asking which classes Royal theme uses for the update cart button/cart quantity instead of the original woocommerce classes.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 28, 2017 at 14:38

    Hello,

    It is our http://prnt.sc/f1uw8h, this is default http://prnt.sc/f1uwma.
    There are used the same “name” attributes.

    Regards,
    Rose Tyler.

    Avatar: Royalty
    Royalty
    Participant
    April 28, 2017 at 14:41

    Thanks, but there have to be different classes or so. Otherwise I dont understand why the code mentioned above works with Storefront, but not with Royal..?!

    Avatar: Royalty
    Royalty
    Participant
    April 29, 2017 at 23:40

    I found a fix for that, so this issue is resolved.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 3, 2017 at 10:19

    Hello,

    I’m glad to hear it.

    Regards,
    Rose Tyler.

  • Viewing 7 results - 1 through 7 (of 7 total)

The issue related to '‘Auto-update cart when quantity changed’' has been successfully resolved, and the topic is now closed for further responses

Helpful Topics

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.