HiEventsDev / Hi.Events

Open-source event management and ticket selling platform. Perfect for concerts, conferences, and everything in between 🎟️
https://hi.events
Other
1.86k stars 138 forks source link

🌟 Ability to limit promo codes to a certain number of tickets #219

Open grablair opened 1 week ago

grablair commented 1 week ago

Describe the bug My use case is that I want to generate a one-time-use, one-ticket promo code to give performers for comp tickets, so admin doesn't need to facilitate the comps.

I was testing this out, and created a test promo code with 1 use, at a 100% discount. I realized during testing that I can buy as many tickets as I want with this promo code, even though I'm only using the promo code once.

I labeled this as a bug and a feature because I'm not sure how it functions now is technically wrong... the verbiage is "How many times can this code be used?" not "How many tickets can this promo code be used for?". That being said, for a use case like this, I don't want to give a user the ability to buy the max number of tickets for free.

To Reproduce Steps to reproduce the behavior:

  1. Create a ticket that has a positive price, and an availability of more than 1
  2. Go to Promo Codes
  3. Create a 100% off promo code with 1 use
  4. Go to the event page
  5. Enter the promo code
  6. Select some number of tickets > 1
  7. Complete order

Expected behavior My intuition is that a 1-time promo code should only be able to be used for 1 ticket. I can see both scenarios though. You may want a promo code that allows for an unlimited amount of tickets at 10% off. You may want a promo code that allows for 20% off 5 tickets. Etc.

Screenshots Screenshot 2024-09-13 at 14 47 27

Alternatives

I can think of workarounds for this, like creating a "Comp" ticket that is tied to the available capacity of the other ticket, but has a purchase limit of 1 per order. However, we have multiple performances with multiple capacity assignments, so this would require creation of one separate Comp ticket per performance, doubling the tickets in the system and adding (IMO) unneeded complexity, since there are definite cases where limited the promo code to a certain number of tickets would be valuable.

daveearley commented 1 week ago

Thanks for the suggestion! I like the idea of having an additional option to limit the number of tickets. I'll add this to the roadmap.

Also, I've removed the bug label, as the current behaviour is expected.

Thanks again.