How would I go about limiting multiple event registrations to the same category.
example – I have 10 events within 3 categories, I would select an event and add the ticket to the cart and then any tickets there after added would have to be in the same category as the first ticket to be added.
Disabling the multiple events registration add-on for certain events is not currently available as the add-on does not have any settings to restrict certain events.
That is, when it is activated, then it allows events to be added to a cart site-wide.
Is there then a hook that is triggered when an event is added to the cart that we could use to query the contents of the existing cart and conditionally remove the new event if it doesn’t match the category of another event in the cart?
If you look in /event-espresso-core-reg/modules/ticket_selector/EED_Ticket_Selector.module.php in the _add_ticket_to_cart method you’ll find the FHEE__EE_Ticket_Selector___add_ticket_to_cart__allow_add_to_cart hook. This can be used to prevent a ticket from being added to the cart.
If you run into any issues where it will help to add a new hook or pass in additional parameter to an existing hook, you can open a pull request and one of the developers can review:
Thanks Josh, I managed to get the feature I wanted using the hook.
Viewing 4 reply threads
The support post ‘MER limit to category’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.