Hello again,
I am trying to figure out a way to be able to limit the amount of items someone could add to their cart. For example, I have a discount package that you could add to get 5% off, but I would like to limit how many times that package could be added to the cart to ensure that people cannot add it more than once to get a higher discount. Has anyone ever tried this?
Any insight is HIGHLY appreciated,
Sav
You could use an action to either increment a counter or set a boolean column when a user adds the item to their cart. And then set a visibility condition to hide the component once the limit is reached or the boolean is set.
2 Likes
Hey Darren! Could you explain more about the Boolean column? I think you may be on to something!
Well, whether I’d recommend a boolean or a number type depends on the number of items you want to limit them to. If it’s just one, then I’d use a boolean, otherwise a number column.
So, let’s assume each user can claim the “discount package” just once.
- You could have a user specific boolean column - “discount package claimed” (or whatever).
- The component that they use to claim the package would have a visibility condition - “when discount package claimed is not true”.
- Then when a user “claims” the discount, you have an action that sets that column to true, and the component disappears.