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

17
g_s7•
2
caffitulateOP•

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!

1
g_s7•

Good to hear. I would still want to investigate why it was set to 2 in the first place though.

1
caffitulateOP•

Yeah, based on the documentation I've seen by default it's set to -1, so either:

  • It was 2 all along, but Woo didn't care/use it until 3.3 or
  • It was -1 all along but somehow upgrading to 3.3 changed it
1
caffitulateOP•

Replying to myself to add some progress. I found this page: https://www.tychesoftwares.com/how-to-set-minimum-and-maximum-allowable-product-quantities-to-be-added-in-woocommerce-cart/

Which let me set 'woocommerce_quantity_input_max', but so far it is only working on the product page, not the View Shopping Cart page, which is still using the 2 value. Very strange this value suddenly changed/is being used.

1
LWD0101010•

Sounds like the product is set to "Manage Stock" and there are only two in stock?

1
caffitulateOP•

Sorry, that was one of the first things I checked! In Stock and Stock Management is disabled. The problem is also happening on all products on the site.

1