Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #592328

    I’m using the WooCommerce Tickets by The Events Calendar. We want to move the Add To Cart portion of the sidebar to the top of the sidebar. I reached out to the developer of the plugin and the code they provided me with to change it, didn’t work and they suggested that it could be code in the theme which is you. Since I know you integrated The Events Calendar into the theme I figured they were right.

    #593722

    Hey levlaneadvertising!

    Thank you for using Enfold.

    How do they place the add to cart container? Are they using hooks? If yes, please ask them which one. You can find the events template in the config-events-calendar > views > single-event.php file.

    Cheers!
    Ismael

    #594425

    The code below was provided by the developers at https://theeventscalendar.com/. Normally it is suppose to move the add to cart somewhere on the page depending on what you specify. Not sure if this answers your question.

    /*
     * 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__WPEC__Main',
    		'Tribe__Tickets_Plus__Commerce__WooCommerce__Main'
    	);
    	// print_r($etp_classes);
    	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');
    //tribe_etp_move_tickets_purchase_form( 'tribe_events_single_event_before_the_meta');
    #596032

    Hey!

    From the above code snippet you provided, this line explains that you need to remove the comment tags from the code that corresponds to where you want the Add to Cart button to be shown. The lower part of the code should look like this to move the Add to Cart to the top:

    /*
     * 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');
    tribe_etp_move_tickets_purchase_form( 'tribe_events_single_event_before_the_meta');

    Try the above and let us know.

    Regards,
    Jordan

    #596311

    I tried it but having two calls to the same function seems redundant. Also the Add To Cart still has not moved.

    #599469

    Hey!

    Please add the following code in Enfold > General Styling > Quick CSS

    .woocommerce.add-to-cart {
        position: absolute;
        top: 20px;
    }
    
    .av-single-event-meta-bar-inner {
        padding-top: 90px!important;
    }

    It should look similar to the screenshot

    Cheers!
    Vinay Kashyap

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.