Home › Forums › Ticket Products › Event Tickets Plus › Template tags to display ticket purchase options?
- This topic has 6 replies, 2 voices, and was last updated 10 years, 1 month ago by
Nico.
-
AuthorPosts
-
March 15, 2016 at 2:27 pm #1089355
Roberta
ParticipantI’d like to display the Add to Cart table within the loop but outside of the Single view. Currently, it only shows if I click into a event. I’m outputting the_content() but I don’t see the ticket purchase table, so I imagine it’s an additional tag I need to place in my template file so this will show up?
March 15, 2016 at 2:34 pm #1089363Roberta
ParticipantOh, I am using WooCommerce to sell the tickets.
March 16, 2016 at 1:20 pm #1089956Nico
MemberHi Roberta,
Thanks for reaching out to us. Interesting question I can help you with it!
To add the tickets form to the events listings (list, day & photo view), go ahead and add this snippet to your theme’s (or child theme) functions.php:
https://gist.github.com/niconerd/0db0311594ddcfc8fa9e
Please give it a try and let me know,
Best,
NicoMarch 16, 2016 at 2:43 pm #1090014Roberta
ParticipantAh, so close! This is actually a custom loop I’m running for a page dedicated to the Live Music category. Is it possible to display the form within a custom query such as this:
<?php if(is_page(7)) { // if a Live Music page // events loop $args = array( "post_type" => 'tribe_events', "eventDisplay" => 'upcoming', 'tax_query' => array( array( 'taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => 'live-music' ) ), "posts_per_page" => '-1', "start_date" => date('Y-m-d H:i:s', strtotime("now")), 'orderby' => 'event_date', 'order' => 'ASC' ); $events = new WP_query($args); while($events->have_posts()): $events->the_post(); ?> <div class="event-listing"> <h2 class="event-des"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <div class="event-content"> <?php the_content(); ?> </div> <p><a href="<?php the_permalink();?>" class="button">View Event Details and Purchase Tickets</a></p> </div> <?php endwhile; ?> <?php wp_reset_query(); ?> <?php } //endif is_page for Live Music ?>March 17, 2016 at 8:58 am #1090304Nico
MemberThanks for following up Roberta!
You can actually fire an action from this code as well. Just add this line after the_content():
do_action('custom_tickets_placement');And update the snippet to this:
https://gist.github.com/niconerd/0db0311594ddcfc8fa9e
Please let me know if that solves the issue,
Best,
NicoMarch 17, 2016 at 11:02 am #1090410Roberta
ParticipantSO simple! Awesome, thank you!
March 17, 2016 at 11:34 am #1090451Nico
MemberGlad to be of service!
I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.
Best,
Nico -
AuthorPosts
- The topic ‘Template tags to display ticket purchase options?’ is closed to new replies.
