Shopping cart values are not updating in case more items are in cart than in stock

This topic has 5 replies, 2 voices, and was last updated 1 hours, 51 minutes ago ago by Kristjan

  • Avatar: Kristjan_Rebane
    Kristjan
    Participant
    September 24, 2024 at 12:49

    For example:
    Customer 1 adds a product (8 items) in shopping cart and 8 are left.
    Customer 2 buys one item of the same product, now only 7 are left, but Customer 1 has still 8 in shopping cart.
    Customer 1 gets notification that only 7 are left and he/she has to update the cart values.
    Customer 1 can change the numbers, but cart gets not updated. Only way to continue is to remove the item from shopping cart.

    Always load “wc-cart-fragments” is turned on.
    Ajax is also turned on from Woocommerce -> Products -> General Settings
    Cached is cleared.
    No additional customization is added.
    Only Plugins activated are Xstore and Woocommerce.

    Getting this error: “jquery.min.js?ver=3.7.1:2 An invalid form control with name=’cart[3041b624a29b78cd03e5dda98f917661][qty_duplicated]’ is not focusable.”

    4 Answers
    Avatar: Kristjan_Rebane
    Kristjan
    Participant
    September 24, 2024 at 12:52

    <input type="number" id="quantity_66f2a5d9d3ad4" class="input-text qty text" name="cart[3041b624a29b78cd03e5dda98f917661][qty]" value="8" aria-label="Toote kogus" size="4" min="0" max="7" step="1" placeholder="" inputmode="numeric" autocomplete="off">

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 24, 2024 at 15:59

    Hello, Kristjan,

    Thank you for getting in touch with us.

    We recommend activating an alternative theme, specifically the Storefront (default WooCommerce theme), to assist in diagnosing the current issues you are experiencing. You can find and activate this theme by navigating to Appearance > Themes in your dashboard.

    Should the problems be resolved upon activation of the Storefront theme, please kindly record a video demonstrating the resolved functionality and send it to us for further review. However, if the issues persist, it indicates that the problem is not theme-dependent, and we advise you to contact WooCommerce support for additional assistance – https://wordpress.org/support/plugin/woocommerce/

    Thank you for your cooperation.

    Warm Regards,
    The 8Theme Team

    Avatar: Kristjan_Rebane
    Kristjan
    Participant
    September 25, 2024 at 07:06

    Storefront does not have Ajax updating the cart automatically, but it has update cart button and it works just fine.
    Btw. when I added same button with your theme using functions.php, it did not work.

    function add_update_cart_button() {
        // Check if we're on the cart page
        if ( is_cart() ) {
            ?>
            <div class="woocommerce-cart-form__update-cart">
                <button type="submit" class="btn button<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?>" name="update_cart" value="<?php esc_attr_e( 'Update cart', 'woocommerce' ); ?>"><?php esc_html_e( 'Update cart', 'woocommerce' ); ?></button>
            </div>
            <?php
        }
    }
    add_action( 'woocommerce_cart_actions', 'add_update_cart_button' );
    Avatar: Kristjan_Rebane
    Kristjan
    Participant
    September 25, 2024 at 07:42

    Here is the video

    Files is visible for topic creator and
    support staff only.
  • Viewing 5 results - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.Log in/Sign up

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