After Woo 3.3 can only add up to 2 products to cart at a time
Hi there; I've posted lots of answers here, but this particular question is stumping me. I've upgraded to 3.3 a couple days ago, and now one of my customers has notified me that they can no longer set quantities of higher than 2 when adding to the shopping cart.
I believe I've found the culprit here, which is the Quantity input textbox on the product single page:
<input type="number" id="quantity_5a7a292b5d415" class="input-text qty text" step="1" min="1" max="2" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" />
So that max value plainly does equal 2, as the behavior is described. (If the customer edits in a higher value it results in a page pop-up saying "value must be less than or equal to 2" when the Add To Cart button is pressed). Changing the max= value in Chrome Inspector confirms that this is what is causing the problem.
So the question is, where is this value set? And why is it only showing up now?
I don't have any min/max quantity order plugins, the product(s) in question don't have "only allow individual orders" checked, and I can't think of anywhere else in Woo that would be putting a value into the "max" setting. Any ideas from someone who has encountered something similar?
As an aside this is definitely new behavior, since the way the site is set up people are often buying in quantities of 10 or more, which also makes it all the more important I fix it!
WP: 5.9.3 WC: 3.3.1 Theme: Flatsome
Posted Feb 6, 2018, 10:41 PM UTC
Here's the official documentation: https://docs.woocommerce.com/document/adjust-the-quantity-input-values/
Hah! That seems to have gotten it. I was worried it was only duplicating what I had done above but with different syntax, but for whatever reason doing it that way worked in all cases, whereas my just setting 'woocommerce_quantity_input_max' only worked on the product page. Thx broseph!
Good to hear. I would still want to investigate why it was set to 2 in the first place though.
Yeah, based on the documentation I've seen by default it's set to -1, so either: