Support

Home Forums Event Espresso Premium Price for FREE events not showing

Price for FREE events not showing

Posted: February 28, 2014 at 2:52 pm


Linda Dessau

February 28, 2014 at 2:52 pm

We’ve recently alleviated an issue of showing the price sans surcharge on our events list, but then an additional price was listed below and listed all events as free. We tweaked the code a bit and it looks fine now on paid events, but now the free events show absolutely no price at all. (http://www.contentmasteryguide.com/events)

Reaching out for a fix for this from the experts as we’re at a loss.

Thanks!


Josh

  • Support Staff

February 28, 2014 at 4:24 pm

Hi Linda,

Can you let us know how the code was tweaked? The context of the code change will help us know what’s going on and will help us toward a solution.


Linda Dessau

February 28, 2014 at 9:23 pm

Hi Josh,

Code for event-list-display can be found here:

https://docs.google.com/document/d/1nBkmL0Q5gQ_XnSfeBzTnRj4zxTAHRuURt_PePf4DP6w/edit?usp=sharing

Thanks!


Tony

  • Support Staff

March 3, 2014 at 4:55 am

Hi Linda,

On line 78 there is this line:

if ( $event->event_cost != '0.00' ) {

That basically says if the event cost is NOT equal to (!=) 0.00 then do whatever is in between { }

So right now it is set to output the price when the price is != 0.00

But if it is equal to 0.00 theres nothing for it to do.

So we change that to:

<?php 
if ( $event->event_cost != '0.00' ) {
?>
    <p id="p_event_price-<?php echo $event_id ?>" class="event_price"><span class="section-title"><?php  echo __('Price: ', 'event_espresso'); ?></span> <?php echo $org_options['currency_symbol'] . do_shortcode('[EVENT_PRICE_SANS_SURCHARGE event_id="' . $event_id . '" number="0"]'); ?></p>
<?php } else { ?> 
    <p id="p_event_price-<?php echo $event_id ?>" class="event_price"><span class="section-title"><?php  echo __('Price: ', 'event_espresso'); ?></span> <?php echo __('Free Event', 'event_espresso'); ?></p>
<?php } ?>

Which says if event_cost != 0.00 output the price using the shortcode to not display the surcharge price.

ELSE

The price must be equal to 0.00, output ‘Free Event’

This is basically what was originally within that file, only now using the shortcode Sidney gave you.

Heres a link to the full file http://take.ms/k3UmY

If you have modified other parts of event_list_display they will not be included within that file, that is stock other than the price output change.

Does that help?


Linda Dessau

March 7, 2014 at 8:41 am

Hi Tony,

That’s perfect!! You guys are awesome and very, very helpful.

Thanks so much!

The support post ‘Price for FREE events not showing’ 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