Support

Home Forums Event Espresso Premium EE4 – Modified Templates in upoads Folder

EE4 – Modified Templates in upoads Folder

Posted: September 26, 2014 at 9:41 am


steeleb88

September 26, 2014 at 9:41 am

I was looking to make some light modifications to the registration checkout page, mostly markup and text changes. I know in EE3, you could put whatever template file you wanted to edit in the wp-content/uploads/espresso/template folder and espresso would use that php file instead. Is this not the case for EE4. Or is there another way I should be doing this? I think most of the files I would like to modify are in /modules/single_page_checkout/templates/


Josh

  • Support Staff

September 26, 2014 at 10:59 am

Hi there,

You are correct, in most cases, EE4 templates do not load from /wp-content/uploads/espresso/templates. Instead, templates can be modified via action and filter hooks using functions. Also, some of the templates can be loaded from a child theme.

If you look through the /modules/single_page_checkout/templates/ you’ll see a number of action hooks that you allow you to add content at each do_action hook point. If you let me know what you’re looking to modify and where, I can point you to the available hooks.


steeleb88

September 29, 2014 at 8:24 pm

I would like to wrap some of the inputs in col divs and remove the additional attendee text at the bottom of the registration page because I will not need that. Would also like to change some of the markup for the ticket info (pricing, desc, qty) display.


Josh

  • Support Staff

September 30, 2014 at 10:12 am

Hi there,

Not sure about wrapping the inputs in column divs because I’m not sure which inputs (and have you tried using CSS for this without adding more markup?)

With the additional attendee text, this can be removed using the filters. If you look in the registration_page_attendee_information.template.php file, you’ll see a few filters like this one:

FHEE__registration_page_attendee_information__attendee_info_not_required_pg

You can remove the additional attendee text with that filter like this:

function my_custom_filter_remove_attendee_info_message() {
  return '';
}
add_filter( 'FHEE__registration_page_attendee_information__attendee_info_not_required_pg', 'my_custom_filter_remove_attendee_info_message' );

For the ticket info, you can specify the location of a custom ticket selector template using a filter. You add the function that uses the filter to a custom snippets plugin or your theme’s functions.php file. Here’s an example function that tells EE to use the template in the /wp-content/uploads/espresso/templates location:

add_filter ('FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', 'my_custom_ticket_selector_template_location');

function my_custom_ticket_selector_template_location(){
    return WP_CONTENT_DIR . '/uploads/espresso/templates/ticket_selector_chart.template.php';
}

Alternatively you could return your theme’s directory as the location to load your custom ticket selector template with:

add_filter ('FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', 'my_custom_ticket_selector_template_location');

function my_custom_ticket_selector_template_location(){
    return get_stylesheet_directory() . '/ticket_selector_chart.template.php';
}

Then copy your modified ticket_selector_chart.template.php file over to the location you specify.


steeleb88

September 30, 2014 at 12:09 pm

I see. Thanks Josh I’ll give this a try and will get back to you if i have any other questions!

The support post ‘EE4 – Modified Templates in upoads Folder’ 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