Move Ticket Form to list view

Home Forums Ticket Products Event Tickets Plus Move Ticket Form to list view

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #1067301
    Matt Gray
    Participant

    Hi,

    I have the Event Ticket Plus plugin and have just figured how to move the Ticket Form to beneath the main content on the single event page, however it’d be really useful to be able to lose the single event page altogether and just have the ticket form, quantity, but it now etc on the mini event view on the list view here: http://new.aquaphysical.com/classes/category/floatfit-classes

    Is that possible, and how would I go about doing that?

    Going to the single page view is just an unnecessary extra click at the moment.

    Thanks!
    Matt

    #1067741
    Josh
    Participant

    Hey Matt,

    Thanks for reaching out to us!

     

     

    You can add to that section by duplicating the “add_action” portion to move the form within the single-event view and changing the first argument for the add_action to “tribe_events_after_the_content”.

    Let me know if this helps.

    Thanks!

    #1067761
    Matt Gray
    Participant

    Hi Josh,

    Thanks for your reply – sorry I’m not particularly au fait with how this works – could you spell it out a bit more please?

    I tried changing it to this, but it didn’t work?

    tribe_etp_move_tickets_purchase_form( 'tribe_events_after_the_content', 5 );
    

    I want it to end up on the list view please…

    Thanks again,
    Matt

    #1067767
    Matt Gray
    Participant

    In fact, that did work – thanks!

    I was looking at an event without a ticket… stupid me!

    Where’s the template to change what’s displayed in the ticket form, and can this be different in different places that it’s placed?

    I also have a shortcode displaying top 3 events here: http://new.aquaphysical.com/floatfit

    How would I add it there too, or would you suggest just using the Events PRO shortcode instead of the one provided with Avada template?

    Cheers,
    Matt

    #1068382
    Josh
    Participant

    Hey Matt,

    There is only a single template for outputting the ticket form. The simplest approach for customizing for the different views would by to use CSS to target the different elements that you don’t want to display.

    I’m not too familiar with the Avada shortcode here. However, if I were a betting man I’d say they probably do something similar to what we do with our PRO plugin and packaging the widgets as shortcodes. With this, you can try following the same steps above but using the “‘tribe_events_after_list_widget'” hook this time and seeing if that works for that shortcode.

    Thanks!

    #1072165
    Matt Gray
    Participant

    Hi Josh,
    Thanks for helping – makes sense RE shortcode.

    Back to the moving of the ticket form, it’s successfully moved here: http://aquaphysical.mattgraydesign.co.uk/classes/category/floatfit-classes

    But I need it on the single page as well…

    How do you successfully move it to these two places?

    tribe_etp_move_tickets_purchase_form( 'tribe_events_after_the_content', 5 );

    tribe_etp_move_tickets_purchase_form( 'tribe_events_single_event_after_the_content', 5 );

    It’s only doing either/or at the moment?

    Thanks,
    Matt

    #1073527
    Josh
    Participant

    Hey Matt,

    Thanks for following up here. I’m glad things are working on the archives now!

    I’m a bit confused on the need for the single here. Check out this item for moving the form on the single event template and let me know if this helps in addressing the issue.

    Thanks!

    #1073865
    Matt Gray
    Participant

    Thanks… the need is that I want people to be able to buy directly from the list page as well as from the individual event.

    Currently it’s moved from the sidebar to the list view only, but I can’t work out how to have it on the archive as well as on the single page view.

    i.e.

    Shows here: http://aquaphysical.mattgraydesign.co.uk/classes/category/floatfit-classes
    But not here: http://aquaphysical.mattgraydesign.co.uk/class/cheshire-lido-manchester

    Can it be on both?

    Currently this is what I have added:

    /*
     * Moves the front-end ticket purchase form, accepts WP action/hook and optional hook priority
     * 
     * @param $ticket_location_action WP Action/hook to display the ticket form at
     * @param $ticket_location_priority Priority for the WP Action
     */
    function tribe_etp_move_tickets_purchase_form ( $ticket_location_action, $ticket_location_priority = 10 ) {
    	$etp_classes = array(
    		'Tribe__Tickets_Plus__Commerce__EDD__Main',
    	//	'Tribe__Tickets_Plus__Commerce__Shopp__Main', // As of ETP v4.0 Shopp will generate errors when referenced, if not active. Uncomment this line if you have Shopp Active
    		'Tribe__Tickets_Plus__Commerce__WPEC__Main',
    		'Tribe__Tickets_Plus__Commerce__WooCommerce__Main'
    	);
    	foreach ( $etp_classes as $ticket_class ) {
    		if ( ! class_exists( $ticket_class ) ) break;
    		$form_display_function = array( $ticket_class::get_instance(), 'front_end_tickets_form' );
    		if ( has_action ( 'tribe_events_single_event_after_the_meta', $form_display_function ) ) {
    			remove_action( 'tribe_events_single_event_after_the_meta', $form_display_function, 5 );
    			add_action( $ticket_location_action, $form_display_function, $ticket_location_priority );
    		}
    	}
    }
    /*
     * TO MOVE THE TICKET FORM UNCOMMENT ONE OF THE FOLLOWING BY REMOVING THE //
     */
    /*
     * Uncomment to Move Ticket Form Below Related Events
     */
    //tribe_etp_move_tickets_purchase_form( 'tribe_events_single_event_after_the_meta', 20 );
    /*
     * Uncomment to Move Ticket Form Below the Event Description
     */
    tribe_etp_move_tickets_purchase_form( 'tribe_events_after_the_content', 5 );
    /*
     * Uncomment to Move Ticket Form Above the Event Description
     */
    //tribe_etp_move_tickets_purchase_form( 'tribe_events_single_event_before_the_content' );
    

    Uncommenting a second line doesn’t allow it to show in both places…

    Thanks,
    Matt

    #1074730
    Josh
    Participant

    Hey Matt,

    That snippet should be specifically for moving the form on the single view. You can control the difference (if I’m understanding correctly) by using conditionals to wrap the statement for where you would like them to display.

    So, you could use:

    
    if( is_archive() ) {...}
    

    around the expression for the category listing and:

    
    if( is_singular( 'tribe_events' ) ) {...}
    

    around the expression for the single event view.

    Let me know if this helps.

    Thanks!

    #1074830
    Matt Gray
    Participant

    This reply is private.

    #1078708
    Josh
    Participant

    Hey Matt,

    Unfortunately we have a strict policy against logging into client site. I’ve removed the login information for your security.

    I believe using the conditionals should work, however I can do some testing here to make sure they are working as expecting here.

    Thanks!

    #1079664
    Matt Gray
    Participant

    Oh sorry – didn’t realise.

    If you could try, that’d be great please…

    I’m not too au fait with creating functions, so if you could just give me a block of code to copy/paste in to my functions.php that’d be much appreciated!

    Thanks v much,
    Matt

    #1079716
    Vivianne
    Participant

    @Matt:
    I need exactly the same thing!
    I need a cart-form in my list-view so clients can book without going to the single-event page.
    But I didn´t understood where exactly you did what.
    Could you explain for me again, which code I need to change in which file?
    That would be so great!

    #1079718
    Vivianne
    Participant

    @Josh:
    If I use the code from here in my theme´s functions.php my page goes blank.
    I work with WooCommerce – is there something special to consider?

    #1081140
    Josh
    Participant

    Hey Matt,

    You can add the ticket form to the list view as well as move on the single view by utilizing the following snippet in your theme’s functions.php file:

    https://gist.github.com/BeardedGinger/39744d77e3efb1667e74

    Vivianne, if this helps you in your situation, awesome! If not, would you mind opening a new thread so we can address every issue/question directly and fully.

    Thanks!

Viewing 15 posts - 1 through 15 (of 17 total)
  • The topic ‘Move Ticket Form to list view’ is closed to new replies.