Posted: July 8, 2013 at 12:33 pm
|
Hello. I am trying to remove the prices from the dropdown menu on the registration page. http://thestarawards.com/register/wp-content/uploads/2013/07/espresso-issue.png I want to remove the price but keep the text that is in front of the price. Also any way to expand that drop down box to make everything appear on one line correctly? |
|
What you want to do is this: remove_action('espresso_price_select', 'event_espresso_price_dropdown', 20, 2); 5. then add this line at the bottom of the file, right after the end of your new function: add_action('espresso_price_select', 'my_custom_price_dropdown', 10, 2); 6. now you are free to customize the dropdown. I believe the line you are looking for is this one: $html .= '<option' . $selected . ' value="' . $result->id . '|' . stripslashes_deep($result->price_type) . '">' . stripslashes_deep($result->price_type) . ' (' . $org_options['currency_symbol'] . number_format($result->event_cost, 2) . $message . ') ' . $surcharge . ' </option>'; and you’ll want to change it to: $html .= '<option' . $selected . ' value="' . $result->id . '|' . stripslashes_deep($result->price_type) . '">' . stripslashes_deep($result->price_type) . ' </option>'; |
|
Hi Sidney, Thanks for this. I’ve done all the steps however I am still getting prices in the drop down menus. http://thestarawards.com/register/?ee=2 |
You could try a slightly simpler approach and copy the entire event_espresso_price_dropdown function to the end of your custom registration_page.php template (skipping steps 4&5). It’s a pluggable function so you can get away with just copying it and it seems to run fine without changing the name and adding/removing the actions. screenshot of modified price dropdown where the price display is removed As an aside, you will need to either enter a reCaptcha API key or disable reCaptcha or the registration page will continue to be broken for logged out visitors. |
|
|
Thanks Josh. I did that and it seems to have made my entire drop down menu disappear. Any ideas? Here’s my code: http://thestarawards.com/register/wp-content/uploads/2013/07/registration_page.txt The real file is php but in order to link it, I had to copy it to a txt file. Thanks again guys! |
I checked and what was copied over is missing the opening: if (!function_exists('event_espresso_price_dropdown')) { and the closing: add_action('espresso_price_select', 'event_espresso_price_dropdown', 20, 2); } |
|
|
That worked! Thanks for your help! |
You’re welcome. One thing to keep in mind is if the function that you’re overriding gets an update in a future release you will likely need to make the same update to your custom function so that it continues to work as expected. A good way to do that is use something like prettydiff.com and run a comparison between your custom function and the version of the same function that ships in future versions of Event Espresso. |
|
The support post ‘Remove Prices from Drop Down’ 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.