Min & Max Quantity #1019
Replies: 8 comments
-
I guess at a simple level it would be easy to achieve. You could even just do it with custom attributes. The difficulty comes when trying to restrict maximum. As a customer could just place multiple orders etc. Defining the "rate limit" on that would be tricky. I thought we already had min. qty though, @alecritson ? |
Beta Was this translation helpful? Give feedback.
-
@glennjacobs I think you're thinking of the old version. Doesn't look like it's on 2.0 |
Beta Was this translation helpful? Give feedback.
-
So I think min. qty can be put in without too much further thought. Max. qty is going to need to be defined somehow. |
Beta Was this translation helpful? Give feedback.
-
@alecritson would this be better served by allowing devs to add their own validation at the time of adding to a cart? |
Beta Was this translation helpful? Give feedback.
-
@AugmentBLU @alecritson @glennjacobs I've written a GetCandy Purchase Limit Addon for multiple kinds of purchase limits. It injects some Rule classes into the Cart/CartLine modifiers pipeline to check various purchase limit rules against the current cart. You can define a criteria for each rule. Currently, these rules are implemented:
Each purchase limit rule allows you to restrict quantity, price, or both of them. There is also an Admin Hub slot which you can register it in product edit page: |
Beta Was this translation helpful? Give feedback.
-
@glennjacobs @alecritson I think it's better to leave the core as it is currently and don't make it fat by such kind of features. Addons would be best suited for injecting such functionalities using either cart or order modifiers. |
Beta Was this translation helpful? Give feedback.
-
@armezit That looks pretty nice, unfortunately it doesn't appear to be working with a fresh install of GetCandy for some reason. I don't see any options anywhere and no errors are appearing in the log. I'll keep looking and will create a repo issue if you cannot replicate. |
Beta Was this translation helpful? Give feedback.
-
@AugmentBLU I will check it asap on a fresh installation to see what's going wrong. Still it would be great if you open an issue on the repo. Thanks |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
It would be great to be able to specify the min or max quantity of a given product or variant that a customer is allowed to purchase.
Perhaps it could be per order or the lifetime of a product as some products might be one-per-customer.
Describe the solution you'd like
Simple Min Max order quantity fields should suffice for the basic idea.
For control over if the limits are per order or lifetime might need more consideration but possibly simple checkboxes. I'm not sure how best to tackle the checks for per-order or lifetime but I did see the
AddToCart
component in the store example that could be extended.Describe alternatives you've considered
Adding events or changing validation at the add to cart process, however the fields will still be required.
Additional context
The idea comes from something that I will be needing in a cart product. Products need to be limited per customer, it is a fairly standard feature in ecommerce platforms. One per customer over a lifetime is something that is difficult to find though, could be a nice addition.
Beta Was this translation helpful? Give feedback.
All reactions