Support » Plugin: WooCommerce » How to disable add to cart button when quantity reaches above a certain amount?

  • Resolved stan255

    (@stan255)


    How to disable add to cart button when quantity reaches above a certain amount?

    I’m using the Storefront theme and it adds the class “disabled” to disable the add to cart button.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Fernando

    (@fhaps)

    Automattic Happiness Engineer

    Hi @stan255,

    It sounds like you are looking to do this through coding. However, I thought I might suggest a plugin in case you’d consider taking that route.

    Min/Max Quantities allows you to establish minimum and maximum limits to the number of products a person can order. The Add-to-cart button isn’t exactly disabled when that limit is reached, however, an error message is shown to the customer if they try to add more items to their cart than the maximum allowed – so that they know what’s going on.

    Hopefully that helps!

    Thread Starter stan255

    (@stan255)

    Thanks for the reply, Fernando.

    I have looked at a few min/max plugins including the one you linked to but the UX isn’t exactly what we are looking for.

    The reason is because the user has to click on the add to cart before he/she finds out about the min/max quantity.

    Currently, we are using the Storefront theme and the add to cart button is disabled unless all the attributes are selected which is fantastic. If not, they can’t add to cart.

    Imagine from the users’ point of view, they selected all the product options and the add to cart button goes from disable to enabled and they can now add to cart.

    They click add to cart and if their quantity doesn’t meet the requirements, it shows them the error message.

    The mindset of the user goes from:
    “Ok, I need to select all the options to add to cart.” to
    “Yes, I can add to cart now because the button is enabled.” to
    “What the… I didn’t know there was a min/max quantity”.

    It is a small thing but I believe it makes a big difference from a UX perspective considering how small this is.

    Plugin Support Fernando

    (@fhaps)

    Automattic Happiness Engineer

    Thanks for the details.

    This isn’t a feature that is included in WooCommerce out of the box, so I can’t offer much advice on that. I don’t know of any plugins that would work like this exactly – so I’m afraid something like this would have to be custom-coded into your website.

    I’ll leave this thread opened for a few more days, in case anyone else from the community has any recommendations.

    Plugin Support Fernando

    (@fhaps)

    Automattic Happiness Engineer

    We haven’t heard back from you or other users in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to disable add to cart button when quantity reaches above a certain amount?’ is closed to new replies.