apply_filters( 'tribe_tickets_get_ticket_default_max_purchase', int $default_max , Tribe__Tickets__Ticket_Object $ticket )
Cap the amount of tickets able to be purchased at a single time (single “add to cart” action) for sanity and performance reasons.
Anything less than 1
will be ignored and reset to the default.
Parameters
- $default_max
-
(int) Maximum quantity allowed at one time (only applicable if the ticket stock available is greater).
- $ticket
-
(Tribe__Tickets__Ticket_Object) Ticket object.
Return
(int)
Source
Changelog
Version | Description |
---|---|
4.11.5 | Introduced. |
To limit the number of tickets that can be added to the cart at a time to 1:
It is also possible to limit this functionality based on ticket properties. For example ticket ID.
Some ticket properties that can be used: