How can I limit product quantity per customer in a checkout session?

How can I limit product quantity per customer in a checkout session?

RLopez
Excursionist
30 0 4

Hi there! We are getting ready to open our store yet had a question regarding product limiting. We are currently looking for a way to limit customers to only X amount of a Product Z in a single checkout session. Is there any way to set this limit? 

Replies 4 (4)

gr_trading
Shopify Partner
1919 145 199

Hi @RLopez 

 

Yes, feature can be created using custom scripting in theme.

 

Let me know if you are willing to hire for this custom dev.

For any custom development WhatsApp or connect at Email ID: [email protected] for quick consultation. | Shopify Free codes
To support Buy Me a Coffee

PaulNewton
Shopify Partner
7121 631 1484

Hi @RLopez For the online sales channel that's either through a theme customization, or app.

Is the X a set amount?

In which case for OS2.0 themes remove the quantity block from the theme and replace it with a hidden quantity amount.

And then on the /cart template hide the inline  quantities buttons using CSS that targets specific variant ids, or customize the template to not render the buttons at all.

 

A crude example to add to a cart template settings in a custom-liquid section:

{% assign limited_item_variant_id = 1234567 %}
{% assign limited_item_variant_max_qty = 3 %}

{% for item in cart.line_items %}
{% if item.variant.id == limited_item_variant_id %}
{% if item.quantity > limited_item_variant_max_qty %}
<style>
button[name="checkout"][form="cart"] { display: none}
</style>
<p>Please remove excess items from cart.</p>
{% endif %}
{% endfor %}

 

The problem isn't often just the raw limiting on the frontend but making sure there is messaging informing the customer, and additional backend processes to handle invalid orders if they get through.

 

An alternative is to just bundle the items into a single priced product, then on the backend use an app to sync inventory between the bundle and individual skus.

Mechanic is an app that can be scripted for specific scenarios, example https://usemechanic.com/task/sync-inventory-for-shared-skus 

 

If you need this customization service you can contact me directly.
Please provide context: store url, theme name, post url(s) and any further detail.
Contact Info in signature.

 

 

Contact [email protected] for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


vai_jpn
Excursionist
24 0 1

I know a few quality limiting add-ons that has capability to fulfill this requirement. You should try them. Try them out - KOR Order Limit Quantity, Evlop ‑ Order Limits, Advance Order Quantity Limits etc.

Exploring Shopify deeply

JimJong
New Member
56 0 0

You can limit the quantity per item for a specific product using the Cart Lock https://apps.shopify.com/cart-lock app. Follow the steps below:

 

  1. Open the app and click on the "Add a new rule" button.
  2. Click "Add a new condition" and select the "Single item quantity" then add 2 or any number in the "Block if more than" field.
  3. Click "Add a new condition" again and select the "Products" and add your "Product Z" product.
  4. In the "Error message" field, add an appropriate message which will be displayed in the checkout page.
  5. Save the rule.

 

limitqty.png

 

Now your customers are limited to the quantity you set for the specific items.