Rae from Shopify here. I'm glad you reached out about this! I can certainly lend a hand.
The best way to create limits on product quantities that customers can order is by using an app. Some of the options I recommend checking out for this are:
Each of these apps can be used to create minimum and maximum order limits on carts, so I believe they will suit your needs well.
It is important to add however, that these are all third-party apps that are created and fully supported by developers who are external to Shopify. With this in mind, if you have any questions or concerns about using these apps, or the charges associated with these apps, please reach out to the app developers directly for more assistance.
In the meantime though, I'd love to hear more about the products you're selling, and how you're hoping to use order limits on your site. Will these be used for sale products, or as part of a discount you're running?
Thanks for following up.
While I don't have any personal experience with free apps that can help set order limits, if any apps like this exist they'll be listed here.
In terms of a coding solution, I recommend reaching out to Shopify Experts about this for more information. Experts are third-party developers and coders who are very knowledgeable and skilled with using our platform, so they're a great resource to use for tasks like this. You can contact them via the 'Create a job' button here.
Let me know if there's anything else I can help with!
Yes you can do it through custom code
// check tag on products