• Resolved daromaster

    (@daromaster)


    Hi! It is possible to deactivate the “add to cart” button on the product file until data is entered in the required fields.

    When creating products with variations, if an option is not selected, the “add to cart” button is deactivated. but when I use the plugin to add a “required” text field, it is not deactivated, but a notification that the data is required.

    I have had these problems with the cart sidebar, since it opens the same, that is, when I have a required field and do not add any data, and I click on “add to cart” the cart sidebar opens (with ajax ), nothing is added and a notification is sent that the data is necessary.

    What I would like is that if the data is required, the “add to cart” button is deactivated, thus preventing the mini cart sidebar from opening.

    I have also had problems using “conditionals”, that is, if there is a selection, it will show a textarea field, but it does not validate it if I set it as “required”. that is, if I click on “add to cart” it adds the same with the blank space.

    Thanks in advance!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • i have the same problem. any news?

    Plugin Author Maarten

    (@maartenbelmans)

    Hi @kamerhuren

    The original poster describes 2 things:

    1) the “add to cart” button not being disabled when a field is required:

    This is not a feature our plugin has at the moment. We do not disable the “add to cart” button like WooCommerce does it. But we do validate the form when “add to cart” is clicked. So a browser error will appear when adding to cart is not possible. If you’re not seeing this error, it means your theme is using “ajax add to cart”. In that case, normal form validation is not possible.

    2) A textarea is set as required but it adds with a blank space.

    This is also probably due to the fact that your theme uses “ajax add to cart”. It’s a modern way to not reload the page when the user clicks “add to cart”. It’s also not a default WooCommerce behavior so unfortunately our free plugin can’t handle ajax add to cart. This is mitigated with our premium plugin (not trying to upsell here – just giving all the info possible).

    If your issue is different than what was described here above, please open a new ticket so we can look into it further.

    Hope this helps!

    Maarten

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘disable button “add to cart” when the field is required.’ is closed to new replies.