Posted: June 26, 2013 at 9:53 am
|
hey there, i am using eventespresso for a major austrian eventlocation and we want to sell tickets online and offline. there are two prices that are only available offline but shall be displayed in the description (price number 0 and 1) and the number 2 that will be the price to buy online. i have found a way to display all the prices in the description but i cant do that trick with the registration i am using the following code to display the custom price:
how can i use that to ONLY open price number 2 for online registration?
thanks a lot. thumbs up eventespresso |
Hello Peter, How are you? I’m not sure I understand quite what you are trying to do. Can you give us the URL to the event page so we can take a look? Also, can you explain a little more about your situation? |
|
Hi Peter, I might be oversimplifying this, but why not type out the offline price options in the event description and only enter the online price as a price option in the event editor? |
|
|
@josh that might be oversimple but that means that we have entered about 100 events uselessly. and the second reason is simple: customer wants it like this.
@johnatan: thing is: i want to enter 3 prices. 2 shall only be for display, the third one shall be the price for the online ticket. does that make sense?
|
Hi Peter, You could use some jQuery to remove the price options that you don’t want displayed in the price option select box. The following code example will remove the first two price options and leave the third price option: <script> jQuery(document).ready(function($) { $("select[name='price_option'] option:lt(2)").remove(); }); </script> |
|
|
hi josh,
and where do i put the code? right before the price options in the registration display file? |
You could put it at the end of the file, but then you’d end up having to maintain a custom registration_page_display.php file when it comes time to update Event Espresso. Instead, you could place the JavaScript inside its own file and load it via the WordPress wp_enqueue_script function. This will keep your custom script safe from getting overwritten on updates -and- avoid template hacking (your customer will be glad you didn’t hack the templates). So what you could do is: jQuery(document).ready(function($) { $("select[name='price_option'] option:lt(2)").remove(); }); Note: Very important, please do not copy and paste in the line numbers, they are there for reference only. add_action('wp_enqueue_scripts', 'my_remove_price_options_script'); function my_remove_price_options_script() { global $load_espresso_scripts; if ( ! $load_espresso_scripts ) return; wp_enqueue_script('my-remove-prices', content_url('/uploads/espresso/remove-prices.js'), array('jquery'), '1.0', true); } |
|
|
uhm. tried to add the script but it doesnt have any effect. |
Hi Peter, What did you name that .js file, because I can’t find what josh referenced on your site? Or can you point us to where that file is located? Wanna make sure you’ve got it setup correctly. |
|
|
quite honestly, folks. good support is different. i figured it out myself after spending a week or more inside the code. good thing about that: i refreshed my php skills. its not about answering questions, its about solutions. if you dont understand the following: “there are two prices that are only available offline but shall be displayed in the description (price number 0 and 1) and the number 2 that will be the price to buy online. i have found a way to display all the prices in the description but i cant do that trick with the registration” … then i have to ask myself if the forum is the best way to support developers and webdesigners using eventespresso. i even bought a support token. that was some months ago. all you guys did was to update the plugin. that rendered all my changes useless since you didnt ask me about it and i was scheduled for a presentation. i am not frustrated anymore, since i managed to fix eventespresso myself. maybe you install a hotline (paid or free .. i dont care) where people can actually CALL you since that forum is useless. my 2 cents. |
Thanks for the feedback. |
|
The support post ‘custom prices for registration and for display.’ 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.