Support

Home Forums Event Espresso Premium Hiding surcharge on new event and edit event pages

Hiding surcharge on new event and edit event pages

Posted: January 24, 2013 at 2:10 pm


Meghan Wolfgram

January 24, 2013 at 2:10 pm

Hi there,

I’m just beginning to get comfortable with EE. GREAT stuff, you guys rock.

I’d like to set a surcharge in “General Settings” and then hide it on both the add new and edit event (event overview) pages.

I have the custom files addon, and I’ve located the includes/functions/main.php and both event_espresso_price_dropdown and event_espresso_get_final_price

That’s where my limited knowledge gets lost. I hope I’m in the right place. I’d like the person creating or editing the event to NOT have access to the surcharge field. I DO want a surcharge to be in place, just one that is set by general settings alone.

I hope that makes sense.


Josh

  • Support Staff

January 25, 2013 at 2:46 pm

Hi Meghan,

I’d recommend avoiding making any changes to core functions to make this happen. This can be done by injecting a few CSS style rules to the admin page. I’ll include a quick and simple code example below that you can add to your custom_functions.php file that will make the surcharge options not display in the event editor. There are better ways to implement this instead of injecting styles directly into the head of all the admin pages, but this will hopefully give you some ideas:

add_action('admin_head', 'my_remove_surcharge_options');

function my_remove_surcharge_options() {
  echo '<style>
    input#add-surcharge, select#surcharge-type{
    display:none;
    }

    label[for="add-surcharge"],label[for="surcharge-type"]{
    display:none!important;
    }
  </style>';
}

The support post ‘Hiding surcharge on new event and edit event pages’ 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