Support

Home Forums Event Espresso Premium functions.php customizations overwritten when upgrading theme

functions.php customizations overwritten when upgrading theme

Posted: December 13, 2015 at 8:38 am


Dave

December 13, 2015 at 8:38 am

I’ve added the following to my functions.php file to show prices without tax on the events:

add_filter( ‘FHEE__ticket_selector_chart_template__ticket_price’, ‘change_ee_ticket_selector_base_price_display’, 10, 2 );
function change_ee_ticket_selector_base_price_display( $ticket_price, $ticket ) {
return $ticket->get_ticket_subtotal();
}

But every time I upgrade my Total theme with the new version functions.php gets overwritten and I loose that customization.

Is there a way to prevent that from happening?

I thought using a child theme could work but within functions.php it says the following:

IMPORTANT: DO NOT EVER COPY AND PASTE ANYTHING FROM THIS FILE TO YOUR CHILD THEME !!!

Any ideas how to keep the site showing prices without tax on events and still have this customization saved even after Total is updated to a new version?


Tony

  • Support Staff

December 13, 2015 at 12:31 pm

Hi there,

When adding custom functions we recommend creating an Site Specific Plugin to add them to.

This prevents the function being removed when you update your theme.

IMPORTANT: DO NOT EVER COPY AND PASTE ANYTHING FROM THIS FILE TO YOUR CHILD THEME !!!

The reason for this will be to prevent you copying the same function into both functions.php files (as it will cause a fatal error), your custom function above it not a part of your themes functions and should only be within the child themes functions.php file however using an ssp mentioned above is the best method to use.

The support post ‘functions.php customizations overwritten when upgrading theme’ 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