Hi.Events icon indicating copy to clipboard operation
Hi.Events copied to clipboard

🐛 "Tickets Remaining" incorrect for tiered tickets when using Capacity settings

Open grablair opened this issue 1 year ago • 2 comments

Describe the bug When showing the overall number of tickets remaining for a tiered ticket, based on a Capacity assigned to the tiered ticket overall, the shown number is actually <capacity remaining> * <number of non-sold-out-tiers>.

To Reproduce Steps to reproduce the behavior:

  1. Create a Tiered Ticket with 2 tiers; ensure "Show available ticket quantity" in the "Additional Options" is enabled
  2. Create a Capacity for the ticket with a capacity of 1
  3. Go to the event page
  4. See that it displays "2 available" when the capacity is actually 1
  5. Try to order 2 tickets, and receive the error "Sorry, these tickets are sold out"
  6. Increase the capacity to 2
  7. Go to the event page
  8. See that it displays "4 available" when the capacity is actually 2
  9. Try to order > 2 tickets, and receive the error "The maximum number of tickets available is 2"

Expected behavior Available tickets should display the capacity remaining. In the above two scenarios, it should show "1 available" and "2 available" respectively

Screenshots Screenshot 2024-09-13 at 09 58 30 Screenshot 2024-09-13 at 10 00 03

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Brave

Hi.Events Version and platform v0.7.0-beta.3 / Docker

grablair avatar Sep 13 '24 17:09 grablair

Hi @grablair,

Thank you for the bug report! The detail is much appreciated.

I think the best solution is to show the quantity available beside each tier, rather than alongside the ticket title. Something like this:

Screenshot 2024-09-13 at 17 30 52

I should have a fix shortly. It will be included in the next release.

Thanks again.

daveearley avatar Sep 14 '24 00:09 daveearley

Happy to help! Looking forward to contributing with code, but my experience with this type of code is minimal, so I hope to learn through reading some PRs for issues.

In the mock-up above, if the total remaining capacity in the capacity assignment is 1, then should the availability text for each tier be "1 available"? In such a case, my intuition would tell me that I could buy one t1 and one t2 ticket, but in reality there is only one ticket left.

I do think the best way to display the remaining quantity for a tiered ticket is the way it's designed currently: the amount remaining for the entire ticket. Any further tier-level granularity should not be communicated textually, but should instead be enforced by the software (i.e. disable the button after you reach the amount for that tier)

It just seems that this "amount remaining for the entire ticket" is calculated wrong. From my analysis, the overall tickets available for a tiered ticket should be the lesser of:

  1. The remaining capacity assignment for the entire ticket (minimum if there are more than 1 capacity assignment for the ticket)
  2. ONLY IF all tiers individually have set amounts left, the combination of all of those. If any individual tier has no limit, this is ignored.

So, in this scenario where there are 8 tickets left in the capacity assignment for a tiered ticket, there are "unlimited" adult-tier tickets, and 2 remaining senior tier tickets, it would look like:

Screenshot 2024-09-13 at 21 05 50

In this scenario, since there are unlimited adult tickets, the 2 remaining senior tickets are disregarded, and you just go with the capacity assignment remaining. The senior tickets get soft blocked after the 2 tickets are selected.


And in this scenario, where there are the same 8 tickets left in the capacity assignment, but 2 tickets left in each Adult and Senior tier, it would look like:

Screenshot 2024-09-13 at 21 22 31

In this scenario, since all tier have limits, the total available is dictated by min(<total-capacity-assignment-remaining>, sum(<all-tier-availability>)), and the individual tiers have individual soft limits, as well.

grablair avatar Sep 14 '24 04:09 grablair

Again, thank you very much for the detail. Your suggestions makes sense to me. I've started work on the changes here. I hope to have it tested and merged this weekend.

Cheers!

daveearley avatar Sep 14 '24 19:09 daveearley