Kindra Goehler
November 22, 2013 at 9:34 pm
Hello, I’m using the following on event_list_display.php
<code><?php if ( $event->event_cost != '0.00' ) { ?>
<?php echo $org_options['currency_symbol'].$event->event_cost; ?>
<?php } else { ?>
<?php echo __('Free Event', 'event_espresso'); ?>
<?php } ?></code>
to show Free Event instead of $0.00. I’d like to do something similar on registration_page_display.php but it doesn’t seem to work. Any advice?
Thanks!
Dean
November 25, 2013 at 12:33 am
Add New Note to this Reply
Hi Kindra,
The registration_page_display.php file gets the price data in a different way, so the above code wont work.
Though not elegant, you could try something like:
<?php
$x = do_shortcode('[EVENT_PRICE event_id="'.$event_id.'" number="0"]');
if ( $x != "0.00" ) { ?>
<?php echo $org_options["currency_symbol"].$event->event_cost; ?>
<?php } else { ?>
<?php echo __("Free Event", "event_espresso"); ?>
<?php }
?>
Kindra Goehler
November 25, 2013 at 1:25 pm
Add New Note to this Reply
Wonderful Dean – thanks for the help!
Kindra Goehler
November 25, 2013 at 2:00 pm
Add New Note to this Reply
Actually, here is a small edit to your code (otherwise the event cost doesn’t show up when the price is greater than 0)
<code><?php
$regprices = do_shortcode('[EVENT_PRICE event_id="'.$event_id.'" number="0"]');
if ( $regprices != "0.00" ) { ?>
<?php echo $org_options["currency_symbol"].$regprices ?>
<?php } else { ?>
<?php echo __("Free Event", "event_espresso"); ?>
<?php }
?></code>