Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi,

    I don’t understand what your problem exactly is.

    What changes do you think?

    The Update Cart button is not triggered, only when you click on it by default.

    Thread Starter madwear

    (@madwear)

    Hi again,

    My add to cart button for example is disabled as long as no variable is chosen: https://screencast.com/t/oM7OiBxjT80T

    I’d like to see the same effect for the “update cart”-button. It should only be clickable when there have been some changes to the cart (e.g. quantities changed etc.).

    Plugin Contributor Mike Jolley

    (@mikejolley)

    This doesn’t sound very beneficial. The cart page is changing in 2.6 anyway https://woocommerce.wordpress.com/2016/04/19/cart-ajax/

    I got this issue with the ‘update cart’ button.’Update cart’ button is not working.

    Says the button is “disabled” : <input type=”submit” class=”button” name=”update_cart” value=”Update Cart” disabled=””>

    woocommerce version 2.6.2 and Cumulo theme.

    Please someone help me.

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @nangthaint88

    Please create your own threads concerning your issues.

    Update cart is now disabled until the item quantities change in the cart, which is when the button becomes available.

    @jesse Pearson

    Thanks.

    How can i create my own threads issues? Please guide to me.

    Hi @nangthaint88

    Here is the function for help you
    function remove_disable_updatecart() {
    ?>
    <script type=’text/javascript’>
    jQuery(document).ready(function() {
    jQuery( ‘.shop_table.cart’ ).closest( ‘form’ ).find( ‘input[name=”update_cart”]’ ).removeProp( ‘disabled’);
    });
    </script>

    <?php
    }
    add_action( ‘wp_footer’, ‘remove_disable_updatecart’, 99 );
    ?>

    Add this function to function.php

    If you want to show on increase or decrease the quantity of items than use this function

    function remove_disable_updatecart() {
    ?>
    <script type=’text/javascript’>
    jQuery(document).ready(function() {
    jQuery( ‘.shop_table.cart’ ).closest( ‘form’ ).find( ‘input[name=”update_cart”]’ ).removeProp( ‘disabled’);
    });
    </script>
    <script type=”text/javascript”>
    jQuery(document).on(“click”,”.reduced.items-count”,function () {
    jQuery( ‘.shop_table.cart’ ).closest( ‘form’ ).find( ‘input[name=”update_cart”]’ ).removeProp( ‘disabled’);
    });
    jQuery(document).on(“click”,”.increase.items-count”,function () {
    jQuery( ‘.shop_table.cart’ ).closest( ‘form’ ).find( ‘input[name=”update_cart”]’ ).removeProp( ‘disabled’);
    });
    </script>
    <?php
    }
    add_action( ‘wp_footer’, ‘remove_disable_updatecart’, 99 );
    ?>

    and please make sure the <?php ?> tags are right otherwise its not working

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Disable update cart button until changes were made’ is closed to new replies.