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

This topic has 6 replies, 3 voices, and was last updated 1 hours, 4 minutes ago ago by Jack Richardson

  • 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.”

    5 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.
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    September 25, 2024 at 10:17

    Dear @Kristjan,

    I hope this message finds you well. We have recently reviewed your website and would like to bring a few points to your attention:

    1. Upon inspection, we noticed that there appears to be no option available to add products to the cart for testing purposes.

    2. We observed that the custom Shop page on your website may be restricting the straightforward addition of products to the cart.

    3. If the functionality to add products is enabled only for logged-in users, could you please provide us with the appropriate wp-admin access credentials? This will allow us to further investigate and assist you effectively.

    4. Additionally, if you are utilizing the XStore Cart builder, you have the option to enable the ‘Update Cart’ button display directly from the widget’s settings. For your convenience, here is a direct link to the setting: https://prnt.sc/wFc-nRRuklek. For more detailed guidance on using the Cart Page Builder with Elementor, please refer to our documentation here: https://xstore.helpscoutdocs.com/article/193-xstore-cart-page-builder-with-elementor.

    We look forward to your prompt response to facilitate the necessary adjustments. Thank you for your attention to these matters.

    Best Regards,
    Jack Richardson
    8Theme’s Team

  • Viewing 6 results - 1 through 6 (of 6 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.