Your Trusted Partner

Category: Woocommerce Fix

Moving the ticket form to the top of the events page [Wootickets]

By default the ticket form generated by WooCommerce Tickets displays just above the related events section (which won’t always be visible) and below the event meta box. This isn’t always desirable but is quite easy to change: here are a couple of examples that show the ticket form being moved progressively higher. The code can simply be dropped into your theme’s functions.php file.

Move Below Related Events

if (class_exists('Tribe__Events__Tickets__Woo__Main')) {
  remove_action( 'tribe_events_single_event_after_the_meta', array( Tribe__Events__Tickets__Woo__Main::get_instance(), 'front_end_tickets_form'), 5 );
  add_action( 'tribe_events_single_event_after_the_meta', array( Tribe__Events__Tickets__Woo__Main::get_instance(), 'front_end_tickets_form'), 20 );
}

Move Below the Event Description

if (class_exists('Tribe__Events__Tickets__Woo__Main')) {
  remove_action( 'tribe_events_single_event_after_the_meta', array( Tribe__Events__Tickets__Woo__Main::get_instance(), 'front_end_tickets_form'), 5 );
  add_action( 'tribe_events_single_event_after_the_content', array( Tribe__Events__Tickets__Woo__Main::get_instance(), 'front_end_tickets_form'), 5 );
}

Move Above the Event Description

if (class_exists('Tribe__Events__Tickets__Woo__Main')) {
  remove_action( 'tribe_events_single_event_after_the_meta', array( Tribe__Events__Tickets__Woo__Main::get_instance(), 'front_end_tickets_form'), 5 );
  add_action( 'tribe_events_single_event_before_the_content', array( Tribe__Events__Tickets__Woo__Main::get_instance(), 'front_end_tickets_form') );
}

Sourced From : The Events Calender

© 2020 Webdesigncr3ator

Theme by Anders NorenUp ↑