Max Quantity - with Custom Options

I have an item setup to have a max-quantity of “4”, but also have a custom option. It seems that the max-quantity doesn’t take effect except for the default option as users are able to add multiple line items, but each line item can have a max quantity of “4”. What I would like to do is prevent any individual user from ordering more than 4 of my item regardless if they are stacked or not and regardless of what option they select.

Is there a way to do this?

<a ... class="... snipcart-add-item" 
  data-item-id="my-item"
  data-item-price="6.00"
  data-item-weight="100"
  data-item-length="8"
  data-item-height="4"
  data-item-width="1"
  data-item-max-quantity="4"
  data-item-custom1-name="Options"
  data-item-custom1-options="None|Option1[+2.00]"
  data-item-custom1-value="None"
  data-item-url="/products/my-item"
  ... </a>

Thanks for the help and any available pointers here. I can’t seem to enforce the amount that a user can check out with unless after entering payment and shipment information there is another cart validation attempt?

Hi @tmack8001, thanks for reaching out!

Do you think our inventory management feature could help with that?

You can tag variations as a single product, so they share the same inventory.

If that is not what you need, can you provide more details of your setup and products?

Thanks.

Yeah I have enabled inventory management and marked this specific product that has 2 variations, really it is one product, but I added a variation to include a commonly added on “accessory” product for an up-sell opportunity. I’m not worried about the inventory of the accessory add on as much as the main product which I have limited supply currently of.

What I don’t understand is why a user would be able to add each variation (there are 2) to a cart at the same time. I’ve been able to reproduce this by performing the following actions:

  1. add the max allowable quantity to the cart of the “default” variation (now cart has max quantity of variation1)
  2. change by selecting the dropdown to the other variant (now cart has max quantity of variation2)
  3. add the default max allowable quantity to the cart again (now cart has 2 line items each at max quantity, but that is 2x the allowable “maximum item quantity” as set in the HTML data-item-max-quantity field)
    … rinse repeat

This way I’ve had some early release users display they can have 3,4 and even 5 line items in the cart all at maximum quantity leading to 2x, 3x, 4x, and 5x what I want to allow any specific user/customer to purchase.

@nelitow is there a way to limit the amount of a specific “Product” in the inventory/store management to prevent this from happening. I would even want to prohibit specific customers from completing multiple orders until I get my supply chain under control… but at least if I could limit how many end up in a specific order that would be enough for now the repeat orders I can simply decline and return payment for if I so choose to.