Support

Home Forums Event Espresso Premium custom prices for registration and for display.

custom prices for registration and for display.

Posted: June 26, 2013 at 9:53 am


peter scharmueller

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:
<?php echo do_shortcode(‘[EVENT_PRICE event_id=”‘.$event_id.'” number=”2″]’);?>

 

how can i use that to ONLY open price number 2 for online registration?

 

thanks a lot. thumbs up eventespresso


Jonathan Wilson

June 26, 2013 at 2:03 pm

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?


Josh

  • Support Staff

June 26, 2013 at 2:23 pm

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?


peter scharmueller

June 26, 2013 at 3:26 pm

@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?

 

its http://www.arenavie.com/web/calendar


Josh

  • Support Staff

June 26, 2013 at 4:00 pm

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>


peter scharmueller

June 26, 2013 at 4:05 pm

hi josh,

 

and where do i put the code? right before the price options in the registration display file?


Josh

  • Support Staff

June 26, 2013 at 5:15 pm

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:
1) install the custom files add-on. You will only need the custom_functions.php file, so if you don’t want to install all the crazy templates it comes with, you don’t have to.
2) once installed you can add a file in /wp-content/uploads/espresso/ and for the purpose of simplicity, we’ll name it remove-prices.js
3) copy and paste this code into remove-prices.js:

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.
4) You can make that script load onto your registration page by adding this function to the custom_functions.php file that you installed in step #1. It can go right after the opening php tag:

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);
}


peter scharmueller

June 28, 2013 at 12:17 pm

uhm. tried to add the script but it doesnt have any effect.


Garth

  • Support Staff

June 29, 2013 at 10:20 pm

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.


peter scharmueller

June 30, 2013 at 1:39 am

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.


Josh

  • Support Staff

July 1, 2013 at 9:51 am

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.

Event Espresso