Support

Home Forums Event Espresso Premium Adding price to custom sidebar

Adding price to custom sidebar

Posted: February 2, 2022 at 1:09 pm

Viewing 1 reply thread


pathwise

February 2, 2022 at 1:09 pm

We have created a slider in the sidebar to show upcoming courses for any particular event. I am wondering, using the code below, how I could add in the price. Is there a particular value that would call on this and add it into the slider?
I would like to add the price of said event underneath the Title of the event. This is used for all events though, and each has a different price. Here is a link as an example: https://nrtraininggroup.com/course-descriptions/amphibian-and-reptile-salvage-methods/
You will see the “slider” created in the sidebar under Upcoming Courses.


<?php while ( $the_query->have_posts() ) {
$the_query->the_post();
?>
<article class="news-slider--item">
<div class="news-slider--image">
<?php if ( has_post_thumbnail() ) { ?>
<img src="<?php
$newsthumbnail = the_post_thumbnail_url('slick-image-lg');
echo $newsthumbnail;
?>" class="img-fluid">
<?php } else { ?>
/images/default-feature.png" class="img-fluid">
<?php } ?>
</div>
<div class="news-slider--content">
<h3 class="news-slider--title">
">
<?php the_title(); ?>

</h3>

</div>
</article>
<?php } ?>


Tony

  • Support Staff

February 3, 2022 at 6:49 am

Hi there,

We don’t currently have a template tag to display just the price in a similar method to the above and the reason for that is partly due to the flexibility allowed with datetimes and tickets in EE.

For example, if you have multiple datetimes (they may or may not all be on the same date), single or multiple tickets on each of those datetimes, tickets assigned to come datetimes and not others and order in the editor/display no necessarily being the order you would want a single price to be displayed etc.

In short, a template tag for all of the above wouldn’t work and I’m still not even covering all uses cases with my example.

The closes we have is a list of all available tickets with their price shown, that can be output with:

espresso_event_tickets_available($post-ID);

Failing that if you want a specific price/ticket from the event(s) you’ll need some custom code for this.

Viewing 1 reply thread

The support post ‘Adding price to custom sidebar’ 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