Home Forums WoodMart support forum Add to Cart AJEX and item quantities

Add to Cart AJEX and item quantities

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #701020

    cc-7620
    Participant

    My add to car AJEX is acting strange and change the quanties of items added to my cart. When you add one item to cart, at qty 4 say, and then you add a second item to cart, the first item qty 4 changes to qty 1. Please see my video “Recording (2)” attached. I believed it had something to do with my multi location (multiloca) but that dev stated even when his plugin is disabled, the theme is acting strange. Please see the Multiloca dev comments below. We have been using your theme and their plugin for over a year and this issue recently developed.

    “Thank you for bringing this to our attention. The base issue is caused by Woodmart theme. Woodmart theme is actually rerunning a lot if Ajax requests on cart which woocommerce does not on the cart. Our plugin is dependent on the woocommerce flow which is essential for our plugin to work if something is hampering it, it might cause issues for our plugin. if you switch from Woodmart to any other theme the issue is not there. If fact even if I disable the MultiLoca plugin I still see some issues in the cart quantities they get refreshed in middle and Woodmart attempts to add them again to cart please find the attached video for the same.”

    #701021

    cc-7620
    Participant

    see private msg

    #701067

    Artem Temos
    Keymaster

    Hello,

    To rule out any AJAX-related conflicts and quantity resets, please try the following checks:

    Disable AJAX add to cart on single product
    – Dashboard > Theme Settings > Single product > Add to cart options > turn off “AJAX Add to cart”.
    – Save and retest.

    Kind Regards

    #701149

    cc-7620
    Participant

    Thank you. I shut the setting off as you requested but the problem still occurs.

    #701164

    Artem Temos
    Keymaster

    As we can see, this option is still enabled. Please disable it and also keep all plugins that are not related to our theme temporarily turned off so we can test it also.

    #701166

    cc-7620
    Participant

    OK, I disabled it on production.. On the sandbox, I give you guys approval to make any changes you want. Can you disable as part of your testing on sandbox?

    #701255

    Artem Temos
    Keymaster

    Please disable this option as well as 3rd party plugins on the staging website so we don’t break anything.

    #701392

    cc-7620
    Participant

    Ok, I have disabled the ajex on staging and also disabled the multi location (MULTILOCA) plugin that controlls inventory in multiple locations. The problem still occurs with their plugin disabled.

    #701440

    Artem Temos
    Keymaster

    As we can see, all the plugins are still enabled on the staging website. Please disable them temporarily so we can check how it works.

    #702101

    cc-7620
    Participant

    OK, I have deactivated a lot of plugins on the staging site. Also the multiloc plugin people have responded with the following information:

    The issue still appears to persist within the file functions.php, specifically between lines 1182–1222, where the item quantity is being explicitly set in the cart. This seems to be disrupting the normal flow and is leading to the inconsistency we are observing.

    We tested this both with our plugin enabled and disabled, and in both cases, those specific lines of code were responsible for the issue.

    To better understand the implementation, could you please help clarify the purpose of those lines and the original intention behind adding them?

    For the time being, we have removed this code on your staging site purely for testing purposes.

    Those lines of code are in the attached TXT file

    #702134

    Artem Temos
    Keymaster

    Hello,

    Could you please specify the exact path to the file you inspected? We have several functions.php files in the theme. Additionally, please provide the theme version number of the file you inspected, as different theme versions may contain different code.

    Also, please disable all plugins on the staging website as we requested so that we can test this.

    Thank you for your cooperation.

    #702333

    cc-7620
    Participant

    I am being told

    The theme activated on your website is “Woodmart Child” so the path of the file is:
    wp-content/themes/woodmart-child/functions.php

    I have disabled the other plugins

    #702472

    Artem Temos
    Keymaster

    Hi,

    Thanks for the path. Since your active theme is WoodMart Child, any code in wp-content/themes/woodmart-child/functions.php is custom and not part of WoodMart. The parent theme doesn’t contain code that sets cart item quantities by default. If those lines are forcing quantities, they are the source of the issue and should be removed. Please keep that custom snippet removed on both staging and production.

    Kind Regards

Viewing 13 posts - 1 through 13 (of 13 total)