blue level
July 10, 2014 at 7:53 am
how can i grab an event price dynamicly i tried this but it dosent work
<code>
<p id="p_event_price-<?php echo $event_id = 17 ?>" class="event_price"><span class="section-title"><?php echo __('Price: ', 'event_espresso'); ?></span> <?php echo $org_options['currency_symbol'].$event->event_cost; ?></p>
</code>
Tony
July 10, 2014 at 9:11 am
Add New Note to this Reply
Hi Blue,
Turns out that code doesn’t show us much. Can you explain a little more please?
Where are you using this?
What exactly isn’t working correctly?
blue level
July 14, 2014 at 4:56 am
Add New Note to this Reply
basicly i just need a bit of code that says get event id 17 price but without the vat
Josh
July 14, 2014 at 3:38 pm
Add New Note to this Reply
Hi Blue Level,
Here is an example of a little function that gets the price for an event. You add this to your functions file:
function espresso_return_price_for_event ( $event_id ) {
global $wpdb;
return $wpdb->get_var($wpdb->prepare( "SELECT event_cost FROM " . EVENTS_PRICES_TABLE . " WHERE event_id = %d" , $event_id ));
}
Then you can add something like this where you want the price to be displayed:
<?php echo '$' . espresso_return_price_for_event( $event_id ); ?>