Support

Home Forums Event Espresso Premium Free Event Conditional on Registration Pages

Free Event Conditional on Registration Pages

Posted: November 22, 2013 at 9:34 pm


Kindra Goehler

November 22, 2013 at 9:34 pm

Hello, I’m using the following on event_list_display.php

<code>&lt;?php if ( $event-&gt;event_cost != &#039;0.00&#039; ) { ?&gt;
				 &lt;?php echo  $org_options[&#039;currency_symbol&#039;].$event-&gt;event_cost; ?&gt;
		  &lt;?php } else { ?&gt;
				&lt;?php echo __(&#039;Free Event&#039;, &#039;event_espresso&#039;); ?&gt;
		  &lt;?php } ?&gt;</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

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

Wonderful Dean – thanks for the help!


Kindra Goehler

November 25, 2013 at 2:00 pm

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>&lt;?php
				$regprices = do_shortcode(&#039;[EVENT_PRICE event_id=&quot;&#039;.$event_id.&#039;&quot; number=&quot;0&quot;]&#039;);
				if ( $regprices != &quot;0.00&quot; ) { ?&gt;
				&lt;?php echo $org_options[&quot;currency_symbol&quot;].$regprices ?&gt;
				&lt;?php } else { ?&gt;
				&lt;?php echo __(&quot;Free Event&quot;, &quot;event_espresso&quot;); ?&gt;
				&lt;?php }
				?&gt;</code>

The support post ‘Free Event Conditional on Registration Pages’ 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