Support

Home Forums Event Espresso Premium PHP code to display price

PHP code to display price

Posted: May 5, 2018 at 9:25 pm

Viewing 2 reply threads


Drio LLC

May 5, 2018 at 9:25 pm

What is the function/filter/hook to display the event price? I have tried echo’ing $event->event_cost, but the price does not display. You can see this at:

http://capitalwineschool.flywheelsites.com/events/essential-blind-tasting-skills-26/

I have a copy of ticket_details.template.php in my child theme and added “Price:” below the “Date” and “Time”. However, <?php echo $event->event_cost; ?> does not display anything. Please advise.


Drio LLC

May 5, 2018 at 9:28 pm

Correction to my previous post — I have a copy of content-espresso_events-datetimes.php in my child theme. I’ve added “Price:” below the “Date” and “Time”. However, <?php echo $event->event_cost; ?> does not display anything. Please advise.


Josh

  • Support Staff

May 7, 2018 at 9:18 am

Hi there,

It might help to explain that in EE4 one event can have multiple tickets, each with their own price. The same also applies to datetimes: There can be multiple tickets, each with their own price, assigned to one datetime.

So the closest function to what you’re looking for is
espresso_event_tickets_available.

example of usage for the espresso_events-datetimes.php template would be:
echo espresso_event_tickets_available($post->ID, false, true);

Viewing 2 reply threads

The support post ‘PHP code to display price’ 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