Support

Home Forums Event Espresso Premium Customize Cart Modal

Customize Cart Modal

Posted: November 10, 2015 at 11:38 am


Hideout Theatre

November 10, 2015 at 11:38 am

I would like to do some customizations of the shopping cart modal (the one with the Return to Event List and Proceed to Registration buttons). Specifically, I need to change the message at the top of the modal, change the text in the Proceed to Registration button (which I have seen in other form posts), add a second button to close the window, and add some donation buttons.

The text changes seem to be pretty simple, but I’m not sure how to add buttons, or what the correct way to do that is. Is there a way to overwrite the entire template for the cart modal?


Josh

  • Support Staff

November 10, 2015 at 12:26 pm

Hi there,

The Event Espresso 4 Multi Event Registration documentation lists the filter hooks that can be used to change the text of the buttons:

https://eventespresso.com/wiki/ee4-multiple-event-registration-add-on/#customizations

Or if you’re looking in the code, anywhere you see an apply_filters() in the code, that means you can override the default using your own function + add_filter().

The entire template for the modal cannot currently be overridden. The recommended way to make customizations is via hooks. If there’s a place in the template code where you could use a new action or filter hook added, please open a pull request and one of the developers will review.

In order to do a pull request for the Event Espresso Multi Event Registration repo, you’ll need to first get access to it since it’s a private repository. You can fill out this form and someone will add your Github account to the repo:

https://eventespresso.com/developers/request-repo-access/


Hideout Theatre

November 10, 2015 at 12:33 pm

As I dig through the code, it looks like perhaps this isn’t officially supported?

I have customized the ticket selector, and see this line which hooks into using a new template:

$templates[‘ticket_selector’] = apply_filters( ‘FHEE__EE_Ticket_Selector__display_ticket_selector__template_path’, $templates[‘ticket_selector’], self::$_event );

But I don’t see something similar in the Multiple Event Registration code.
I see this:

return EEH_Template::display_template( EE_MER_PATH . ‘templates’ . DS . ‘cart_results_modal_dialog.template.php’, $template_args, true );

Am I correct in assuming that I will have to either a) modify the Multiple Event Registration code to look for a filter to get an alternate template or b) edit cart_results_modal_dialog.template.php directly?


Hideout Theatre

November 10, 2015 at 12:49 pm

OK, that makes sense.

Related: is there a way to make Multiple Event Registration skip the modal entirely and go right to the cart/checkout page?


Lorenzo Orlando Caum

  • Support Staff

November 10, 2015 at 1:09 pm

Hi, I’m not sure I understand how that would work.

The modal presents the registrant/attendee with various options including continuing registration and going to registration checkout.

If it was set to go directly to registration checkout upon adding to the event cart, then a registrant/attendee would not be able to register for multiple events at once.


Lorenzo


Hideout Theatre

November 10, 2015 at 1:46 pm

That’s true. It is a strange request.

Really, what I need to do is put buttons on the cart checkout page that will add tickets to the cart and then reload the cart. Is there an easy way to do that? I am trying to implement asking them to add an option donation to their cart before they checkout and purchase their event tickets.

Is there an add_to_cart function in the MER plugin for EE4?


Josh

  • Support Staff

November 10, 2015 at 3:29 pm

No there is not an add_to_cart function in the MER plugin for EE4. There isn’t really an easy way to add more tickets to the cart via the modal or cart checkout page. The ticket selector table itself would be the easiest way to add more tickets to an order. For example, you could create tickets for donations (or donations + access to the event), and modify the the ticket selector template so instead of displaying rows of a table, you make it display buttons.

If you want to extend the Multi Event Registration cart, your way forward would be to add the hooks you need and submit a pull request.

The support post ‘Customize Cart Modal’ 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.

Event Espresso