Woocommerce_add_to_cart_validation doesn’t work properly

This topic has 2 replies, 2 voices, and was last updated 2 years, 3 months ago ago by Olga Barlow

  • Avatar: IvanMTK
    IvanMTK
    Participant
    January 16, 2022 at 05:01

    I’ve been dealing with an issue related to woocommerce validation specifically when using the woocommerce_add_to_cart_validation hook.

    The issue is whenever I pass $passed = false within the hook, the banner with the error isn’t shown until the user goes to the cart page.

    The code in which I’m doing that in is in functions.php file in the child theme.

    Please, contact administrator
    for this information.
    1 Answer
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    January 17, 2022 at 15:14

    Hello,

    Actually, additional customization is outside the scope of our support https://themeforest.net/page/item_support_policy

    We use Ajax add to cart and it could be the reason why you don’t see notices on the single product. So, go to Theme Options > WooCommerce > Single product builder > Add to cart > disable Ajax add to cart option.

    Also, take into account that copying of the files from the framework folder could cause the issue after theme updates. So, don’t copy whole the file but only functions from the files of that folder and copy them to your child theme functions.php file if you want to change any function from the woo.php file.

    Regards

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

The issue related to '‘woocommerce_add_to_cart_validation doesn’t work properly’' has been successfully resolved, and the topic is now closed for further responses

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