Support

Home Forums Event Espresso Premium Modify EE Multi Event Registration Templates

Modify EE Multi Event Registration Templates

Posted: August 6, 2017 at 3:40 pm


George

August 6, 2017 at 3:40 pm

Hello,

Please how can i modify the following EE Multi Event Registration Templates:

  • event_cart.template.php
  • cart_results_modal_dialog.template.php

Is there a filter which i can use to redirect EE to the modified templates in my child theme or Do i just copy the files to a specific place within my child theme, if so, please can you let me know where in my child theme to copy the files or the filter to use?

Thanks.


George

August 7, 2017 at 4:54 am

Hello,

Found this post, my question has already been answered there; solved it.

Thanks


George

August 7, 2017 at 5:56 am

Hi,

Please i have a challenge pertaining to this;

Within the template event_cart.template.php, how can i modify the contents of $event_cart variable which holds the cart items? I want to change its html structure.

Does it have a separate template or does it have a hook i can use to modify the function generating its values just like the $event_cart_header ?

Please can you respond asap, thanks alot.


George

August 7, 2017 at 7:21 am

Or is there a way to override EE_Event_Cart_Line_Item_Display_Strategy.php?

Please respond


Tony

  • Support Staff

August 7, 2017 at 3:05 pm

Hi there,

Currently there is no filter in place that will allow you to modify the content of $event_cart and you can override EE_Event_Cart_Line_Item_Display_Strategy.php.

What you can do is generate all of your own HTML within the event_cart.template.php rather than using the $event_cart variable. You could also build your own display strategy based on EE_Event_Cart_Line_Item_Display_Strategy and then call that to output the details exactly how you prefer.

I can request a filter is added into the add-on for the HTML that is returned by EE_Event_Cart_Line_Item_Display_Strategy, however, even if that filter is in place you will still need to create all of your own output and possibly use your own display strategy to do so (which can be done without the filter as is) as it’s basically returning a string of HTML which you can’t easily edit.


George

August 7, 2017 at 3:35 pm

Please can you share a sample code on how i can call/implement my own custom EE_Event_Cart_Line_Item_Display_Strategy.php which i have created and uploaded to my child theme?


Tony

  • Support Staff

August 7, 2017 at 3:48 pm

That’s outside the scope of support, as to do so I would need to write my own display strategy.

EE_Event_Cart_Line_Item_Display_Strategy.php is a file within the add-on, why you created your own version of it and uploaded it to your child theme? As mentioned you can not override that file within the add-on.

But you can create your own function within a Custom Functions Plugin that returns the HTML that you want (or add the output directly to event_cart.template.php as mentioned above).

You want to edit the HTML, right?

$event_cart is basically a string of HTML that is returned from EE_Event_Cart_Line_Item_Display_Strategy, meaning you can’t just edit specific sections. EE_Event_Cart_Line_Item_Display_Strategy generates multiple sections of HTML from the line_item passed to the object, you need to repeat this to output the structure you want.

So you need to generate your own output, using the functions from EE_Event_Cart_Line_Item_Display_Strategy as a guide to rebuild and generate your own output.

The support post ‘Modify EE Multi Event Registration Templates’ 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