Home › Forums › Min Max Default Quantity for WooCommerce › Define max & default at 1
- Support forum for the Min Max Default Quantity for WooCommerce.
- This topic has 2 replies, 2 voices, and was last updated 2 years, 10 months ago by WPWhale.
July 29, 2020 at 12:17 am #104423Kieran ChapmanParticipant
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.”
July 29, 2020 at 8:07 pm #104424Kieran ChapmanParticipant
- This topic was modified 3 weeks, 5 days ago by Omar Dabbas.
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.”July 30, 2020 at 10:20 pm #104425WPWhaleModerator
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.
- You must be logged in to reply to this topic.