Define max & default at 1

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #104423
    Kieran Chapman
    Participant

    I set a product to have a default quantity of 1 and a maximum quantity of 1 (i.e. you can only order 1 at a time). However, I keep getting this error when trying to add the item to my cart:

    “Maximum allowed quantity for Free Tap Sticker is 1. Your current item quantity is 2.”

    #104424
    Kieran Chapman
    Participant

    I found the problem: if I already have an item in my cart, then go back to the product page and try to add it, I get the error “Maximum allowed quantity for PRODUCT_NAME is 1. Your current item quantity is 2.” It’s confusing, though: I’ve set my quantity to 1 (on the product page) … the error should be clearer, perhaps something like “Maximum allowed quantity for PRODUCT_NAME is 1. You already have 1 PRODUCT_NAME in your cart.”

    #104425
    WPWhale
    Moderator

    Hi Kieran,

    I have some notes here please.

    1) WooCommerce default behavior is to add the same item quantity to the same item in the cart, so adding 1 after 1 will be 2 in the cart, and that’s why you’re getting the message, you can customize this with some PHP tweek or a plugin.

    2) The message is customizable from the Maximum Quantity tab, you can add variables (like product name) there the way you want.

    3) Having default & maximum of 1 might cause other issues, because you’re simply forcing two settings for one purpose, you can just set the max to 1 (default always goes 1), or use Allowed quantity of 1 as well.

    I hope this helps, please let me know if you need any further help.

    Omar

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.