Moving the ticket form in my custom post type layout.

Home Forums Ticket Products Event Tickets Plus Moving the ticket form in my custom post type layout.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1116243
    metapixel
    Participant

    I 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!

    #1116246
    Brook
    Participant

    Howdy 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

     

    #1116250
    metapixel
    Participant

    Adding 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.

    #1116256
    metapixel
    Participant

    Don’t mind my previous comment. I already got it to work. Thanks for the help and fast response!

    #1116535
    Brook
    Participant

    Oh perfect! Thanks for getting back May-i. Sorry it gave you trouble at first.

    Let us know if you need anything else. Cheers!

    – Brook

    #1116842
    metapixel
    Participant

    One 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!

    #1117033
    Brook
    Participant

    If 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
    #1122531
    Support Droid
    Keymaster

    This 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.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Moving the ticket form in my custom post type layout.’ is closed to new replies.