Home › Forums › Ticket Products › Event Tickets Plus › Moving the ticket form in my custom post type layout.
- This topic has 8 replies, 4 voices, and was last updated 9 years, 10 months ago by
metapixel.
-
AuthorPosts
-
May 18, 2016 at 9:40 pm #1116243
metapixel
ParticipantI have Event Tickets Plus and Woocommerce installed in my website. I have enabled Event Tickets Plus for my custom post type and it is working as intended. What I want to do is customize the layout of my custom post type with the event tickets form.
As of now, the ticket form is appearing after the content. I need to remove the ticket form from the content and move it elsewhere on different column. How do I go about that?
Thanks!
May 18, 2016 at 10:00 pm #1116246Brook
ParticipantHowdy May,
That is completely possible. Here is an example that removes it from the default “the_content” area and moves it to “the_post” :
[php]function tribe_move_tickets_in_page ( ) {
if ( !class_exists(‘Tribe__Tickets_Plus__Commerce__WooCommerce__Main’) ) return;
// remove default action
remove_action ( ‘the_content’, array ( Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(), ‘front_end_tickets_form_in_content’ ) );
// add new action
add_action ( ‘the_post’, array ( Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(), ‘front_end_tickets_form’ ) );
}
tribe_move_tickets_in_page ();[/php]If you know want to put it somewhere else on the other than the_post then you can remove that line from the above snippet, and just call this PHP wherever you need:
Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance()->front_end_tickets_form();Does that do what you were looking for?
Cheers!
– Brook
May 18, 2016 at 10:12 pm #1116250metapixel
ParticipantAdding the first code in my functions.php breaks the website. Is there something wrong with the code? This could probably solve my what I’m looking for but I think there’s something wrong with how the code was written.
May 18, 2016 at 10:54 pm #1116256metapixel
ParticipantDon’t mind my previous comment. I already got it to work. Thanks for the help and fast response!
May 19, 2016 at 10:06 am #1116535Brook
ParticipantOh perfect! Thanks for getting back May-i. Sorry it gave you trouble at first.
Let us know if you need anything else. Cheers!
– Brook
May 19, 2016 at 8:46 pm #1116842metapixel
ParticipantOne more thing. How is this done with the RSVP? I thought it would affect the RSVP form but it’s still being placed after the content. Thanks in advance!
May 20, 2016 at 8:23 am #1117033Brook
ParticipantIf you add this to the above function it will remove RSVPs as well:
remove_action ( 'the_content', array ( Tribe__Tickets__RSVP::get_instance(), 'front_end_tickets_form_in_content' ) );And then to put the RSVP somewhere else:
Tribe__Tickets__RSVP::get_instance()->front_end_tickets_form_in_content();And there you have it!
- Brook
June 4, 2016 at 9:35 am #1122531Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Moving the ticket form in my custom post type layout.’ is closed to new replies.
