Attempting to move Tickets under Event Description

Home Forums Welcome! Pre-Sales Questions Attempting to move Tickets under Event Description

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1084068
    Steven Harris
    Guest

    I tried to follow the knowledgebase directions for moving the tickets below the event description, but got an error on the functions.php when attempting to save the file.

    screenshot

    screenshot 2

    The code I used was:

    <?php
    
    /*
     * 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_single_event_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' );

    I put it at the bottom of the functions.php. I’m using the Salient theme. I’m not exactly sure that I put the code in the right place. It worked, after giving me an error message(screenshot 1), but then the site crashed and showed the second error (screenshot 2).

    Thank you for your help!!

    #1084367
    George
    Participant

    Hey Steven,

    At the start of your code snippet is an opening PHP tag, like this:


    <?php

    If you remove this from your snippet, does anything improve?

    — George

    #1090330
    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 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Attempting to move Tickets under Event Description’ is closed to new replies.