2
votes

I'm looking for help to limit product/variant quantity using script editor app in Shopify Plus. The goal is to only allow one quantity to be able to add to cart per checkout for some specific variant ids in different products.

1

1 Answers

5
votes

There is no supported API for this, but you can update the line item object instance variables directly:

line_item.instance_variable_set(:@quantity, max_quantity)