How do I limit the total quantity per product that the customer can purchase?

How do I limit the total quantity per product that the customer can purchase?

JosephAMichael
Tourist
11 0 24

We have very low print run items in our shop.

 

I just need a fix to edit the liquid code for the various product variations that allows us to limit it to 1 or 2 TOTAL per customer, no matter which variants/option they pick.

 

Can we limit it at the global product level instead of having to go into the individual options?

 

Can we display text that says, limit x per customer?

 

Limit Quantity, Limit Total, Limited Edition

 

I want to hard code this and don't want to mess with a monthly app with more features.

 

Can someone help me out?

Replies 7 (7)

Zworthkey
Shopify Partner
5581 642 1577

@JosephAMichael 

Welcome to the Shopify community!
Thanks for your good question.

 

Please share your site URL,
I will check out the issue and provide you a solution here.

Dbuglabpvtltd
Shopify Partner
705 75 117

Hi @JosephAMichael 

you can do this by using some liquid code and jquery code.
when customer change the value match the value with maximum one if its low or equal to the maximum one add cart button will work otherwise not working.

banned
JosephAMichael
Tourist
11 0 24

Can you share or screenshot me what the code should be changed to?

Dbuglabpvtltd
Shopify Partner
705 75 117

Hi @JosephAMichael 
Have to write code according to your website.
It will take 3-5 Hours.

banned
JosephAMichael
Tourist
11 0 24

How much in usd will it cost and what is your turnaround to complete it?

 

Can you make sure that nothing else will break or change with the coding?

Ankit_Thakur
Shopify Partner
85 1 9

Hi @JosephAMichael 

If you are still looking for a solution to this you can try using the Checkout Guardian app, wherein you can restrict the user to a maximum number of purchase and if added more he wont be able to checkout. You can display a customised message to the client saying you can order only 2 products from the store and further restrict them from future purchase also.


Let me know if you find this app suitable as per your requirment. 

Shopify Developer/Consultant
If my suggestions are useful, please let me know by giving it a like or marking it as a solution.
And if you want to customize or develop new feature on Theme or App.
Skype:-ankit.thakur_5

JimJong
New Member
56 0 0

Hello Joseph, you can limit per item quantity to any fixed number 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" option then add quantity limit like 2.
  3. In the "Error message" field, add an appropriate message which will be displayed in the checkout page.
  4. Save the rule.

limit2.png

That's it. Now your customers cannot buy more than 2 quantity per items.