verbb / events

Craft CMS Plugin for events management and ticketing.
Other
22 stars 13 forks source link

Total ticket capacity doesn’t appear to be enforced #158

Closed kennethormandy closed 3 days ago

kennethormandy commented 1 week ago

Describe the bug

An event’s total ticket capacity doesn’t appear to be enforced.

I don’t see any use of Commerce 5’s new inventory system, so I’m wondering if that’s why? Possibly relevant: https://github.com/craftcms/commerce/issues/3558

The min and max quantity for the ticket appear to work correctly. As long as you stay within that, the event will never be full, and you can always purchase more tickets.

I’m not seeing the total tickets purchased update here:

Screenshot 2024-11-13 at 10 04 12 AM

Even though I have more tickets than the total capacity purchased showing up under tickets:

Screenshot 2024-11-13 at 10 04 22 AM

Thanks!

Steps to reproduce

  1. Create a new ticket with a total capacity of 1
  2. Checkout with one ticket
  3. Checkout with another ticket

Craft CMS version

5.5.0.1

Plugin version

3.0.2

Multi-site?

No

Additional context

Craft Commerce v5.2.3

engram-design commented 1 week ago

We don't use the inventory system because it's probably overkill for what we need. It should be being enforced by both getStock() and getIsAvailable(). So you shouldn't be able to add more tickets than allowed to the cart.

I have a feeling this might've been due to another issue which isn't reporting the correct number of seatsPerTicket value, which effects the number of purchased tickets made. This was to fix a migration issue late in the release, which I didn't check properly. You can see that it's still showing 2 available, and you can keep buying those tickets as a result.

Should be fixed for the next release. To get this early, run composer require verbb/events:"dev-craft-5 as 3.0.2". Just ensure you re-save your ticket types (no need to re-generate tickets).

engram-design commented 3 days ago

Fixed in 3.0.3