Support

Home Forums Event Espresso Premium Whats the Shortcode to Add Pricing Name to Template File

Whats the Shortcode to Add Pricing Name to Template File

Posted: May 15, 2013 at 2:41 pm


Jeanette Green

May 15, 2013 at 2:41 pm

Hey Guys,

Could anyone tell me which piece of code id need to use to print the ‘Standard Pricing Name 2’ box into my template file please?

I use:

<code><?php echo do_shortcode(‘[EVENT_PRICE event_id=”‘.$event_id.'” number=”0″]’);?> <?php echo do_shortcode(‘[EVENT_PRICE event_id=”‘.$event_id.'” number=”0″]’);?></code>

to print the price, but I would also like the ability to print the name box into there too.

Best,

Andrew


Josh

  • Support Staff

May 15, 2013 at 7:15 pm

There really isn’t a shortcode that will display just one price type label. What happens is it does this automatically if there is more than one price type. (The price types appear in the dropdown selector.) If you look in the registration_page_display.php template on line 183, you’ll see that it loads up the price selector from the “espresso_price_select” action.

The function that fires on the espresso_price_select action is in /includes/functions/pricing.php (event_espresso_price_dropdown). In order to get the price type to display, you could copy that function, add it to a custom functions file, and modify it to suit your needs.


Jeanette Green

May 16, 2013 at 6:32 am

Hi Josh,

To be honest, we’re never really going to have multiple prices for events, but she does use different pricing structures, so on one event, the price will be ‘Price Per Team’, on another it’ll be ‘Price Per Age Group’, some it’ll be ‘Price Per Entry’ etc.

So basically she wants to display text after the Price which displays in the template. I guess the best way of doing that would be for her to type ‘Price Per Age Group’ in the price name box, and somehow get that to print into the template when its called for?

Hope you can help.

Andrew


Josh

  • Support Staff

May 16, 2013 at 2:48 pm

Hi there,

The price types are intended to be used in cases for multiple prices. What you’re trying to accomplish would be a good use case for the event meta key and [EE_META] shortcode. They can enter the unique Price label as a meta key.

So what you can do is modify the registration_page_display template where it normally says “Price:” to instead output the [EE_META] shortcode with your custom price label key.

See our shortcode documentation for code examples:

https://eventespresso.com/wiki/shortcodes-template-variables/#ee-meta


Jeanette Green

May 16, 2013 at 4:11 pm

Hey Josh,

Thanks for your reply on this. I infact was looking into the EE_Meta shortcode just today on this issue, and have a similar question on almost the same topic which I posted earlier today on the EE Premium forum. Reading this thread, and the newer thread I created, I think it would have been more appropriate to have added my question onto this thread, but for whatever reason, I didn’t. Before I commit to your answer, would you be kind enough to head over to the new thread and have a read and make a suggestion?

I’ve basically asked about using the EE shortcode in another part of the site to accomplish my requirements… https://eventespresso.com/topic/using-my_meta_key-in-place-of-number-of-tickets-can-it-be-done/

Thanks Josh, and sorry to be a pain! Still trying to work out how best to use EE, and customise it to our own requirements.


Dean

May 17, 2013 at 4:42 am

I responded to the other thread Jeanette.


Jeanette Green

May 17, 2013 at 8:55 am

Thanks Dean.

The support post ‘Whats the Shortcode to Add Pricing Name to Template File’ 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