Hey i need just 2 more Shortcodes for Display.
How can i display Sold out and the price in the event list?
Christoph Steinlechner
Hi Christoph,
Can you provide a bit more detail on what you’re trying to achieve? Can you give an example of how you plan to use these shortcode, and where?
The booking form already displays ‘sold out’ if the ticket has sold out. If selling by date it will disable sold-out dates. Lastly, it will display a sold out message if all tickets are sold out.
Stephen Harris
After startdate i want eg: %event_price%
[eo_events numberposts=10 group_events_by=series showpastevents=false]
%event_title%
%event_venue%
%start{d.m.}% – %end{d.m.o}%
[/eo_events]
and in the same if the seminar is sold out display text like sold out.
Christoph Steinlechner
Ok, those placeholders aren’t available. When you require a bit more advanced logic (extracting a ticket price, or displaying a message subject to a condition), the best way forward is to use the shortcode template not the placeholders.
If you use the shortcode as self-closing. i.e. not [/eo_events]
then it will default to the template in templates/shortcode-event-list.php
. You can then implement the desired output using PHP.
If you need any help on doing that, just let me know. But you can get the tickets of an event with eo_get_event_tickets( get_the_ID() )
and you can get remaining tickets with:
$occurrence_tickets = eo_get_the_occurrences_tickets( get_the_ID() );
$sold_out = ! $occurrence_tickets || ! eventorganiser_list_sum( $occurrence_tickets, 'available' );
if ( $sold_out ) {
echo 'Event sold out';
}
Stephen Harris