verbb / events

Craft CMS Plugin for events management and ticketing.
Other
21 stars 12 forks source link

Event capacity and ticket capacity #130

Closed mihob closed 8 months ago

mihob commented 10 months ago

Question

Is it really necessary to set a capacity for each ticket?

For example, I have an event with 100 seats and three different tickets. Even if the distribution of the tickets is completely irrelevant, I have to set a capacity for each one. Why is that?

Additional context

No response

engram-design commented 10 months ago

No, you don't have to if you don't want to. The option is there to control both ticket and event capacity, should you need that fine-grained level of control.

Say you have an event with 100 seats and Child + Adult tickets. You can just not set a quantity on those tickets so that there are no limits to how many tickets can be purchased (until all 100 are sold)

In another scenario, you might only allow 25 Child tickets, and 75 Adult tickets. Using the quantity allows you to control this.

The quantity for a ticket also acts like inventory, and is decremented whenever someone purchases a ticket of that type for the event. This may very well change in the future, as it's ambiguous, and can lead to deadlock issues (you edit the value while someone is purchasing that ticket - you get inconsistent results.

mihob commented 10 months ago

If the quantity field is left empty, 0 is saved as the value and the ticket is not available.

engram-design commented 10 months ago

Ah, right you are - that's incorrect behaviour (see https://github.com/verbb/events/commit/5fa7893f28976f080d6c9bc83825201803a4985c).

Fixed for the next release. To get this early, run composer require verbb/events:"dev-craft-4 as 2.0.2".

CaporalJuju commented 9 months ago

the bug is not fixed. the ticket quantity is automatically reset to 0 with release 2.0.2 a condition must be added to be functional

  $ticketModel->quantity = null;
        if ($ticket['quantity']) :
            $ticketModel->quantity = (int)$ticket['quantity'];
        endif;

you can't put an infinite total capacity on top of infinite tickets either

engram-design commented 9 months ago

Right, that's why we added https://github.com/verbb/events/commit/fba54ca475cc1dd24e179cbe8625529addbf1c9b which is unreleased. Is that not working for you?

engram-design commented 8 months ago

Should be fixed in 2.0.3