tatifox
tatifox

Reputation: 119

How to limit product/variant quantity using Shopify Plus Script Editor app?

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.

Upvotes: 2

Views: 1584

Answers (1)

Mark
Mark

Reputation: 51

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)

Upvotes: 5

Related Questions