Forum Replies Created
-
AuthorPosts
-
September 7, 2017 at 11:35 am in reply to: Event Tickets Causing Slow Loading on WooCommerce Memberships Admin Page #1346203September 7, 2017 at 9:51 am in reply to: Event Tickets Causing Slow Loading on WooCommerce Memberships Admin Page #1346137KyleParticipant
Thanks for the update Nico, I will let you know how it goes!
February 7, 2017 at 4:18 pm in reply to: Can't edit tickets — admin-ajax.php 500 (Internal Server Error) #1231000KyleParticipantI’ve investigated further and was able to resolve the issue. I’m going to describe how I solved it in case it might be helpful to others who stumble across this thread.
I found out that it was due to a function that I had in my functions.php file to move the location of the ticket purchase form. Here is the function that caused the problem:
/** * Tribe Event Tickets Plus * Move Ticket Form Below the Event Description * @see tribe_etp_move_tickets_purchase_form() */ tribe_etp_move_tickets_purchase_form( 'tribe_events_single_event_after_the_content', 5 ); /** * 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 ); } } }
I found another support topic complaining of the same error and they mentioned removing unnecessary items from the $etp_classes array solved the problem for them. My stack trace indicates the error stems from the following source:
#0 /.../plugins/event-tickets-plus/src/Tribe/Commerce/EDD/Main.php(1068): Tribe__Tickets_Plus__Commerce__EDD__Main->get_ticket('1544', '5690')
Since I’m using WooCommerce I’ve removed items not related to WooCommerce from the array and it solved the issue. The function now looks like so:
/** * Tribe Event Tickets Plus * Move Ticket Form Below the Event Description * @see tribe_etp_move_tickets_purchase_form() */ tribe_etp_move_tickets_purchase_form( 'tribe_events_single_event_after_the_content', 5 ); /** * 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__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 ); } } }
I can’t remember if I got this function from your site or not, but if you recognize it and it is something that has been shared in your official documentation, please be advised that it is causing these issues.
- This reply was modified 7 years, 2 months ago by Kyle.
January 19, 2017 at 11:18 am in reply to: Event Tickets Causing Slow Loading on WooCommerce Memberships Admin Page #1221082KyleParticipantThis is wonderful! I know there are definitely other things going on that are contributing to the load time, not just your plugins. I think this snippet is helping though, and every little bit counts, so thank you! 🙂
I really appreciate your guys’ awesome support team, you’re so responsive and supportive. I hope you both have a wonderful day!
January 13, 2017 at 10:43 am in reply to: Event Tickets Causing Slow Loading on WooCommerce Memberships Admin Page #1218216KyleParticipantThanks George, this looks perfect! I’m excited to try this out!
KyleParticipantHere is a mockup of what I’m envisioning:
KyleParticipantHi George,
Here is a screenshot of the page I’m talking about:
I’m sure you’ll recognize this page – the WooCommerce “My Account page” – the front-facing page where customers can view their order history, edit their addresses, etc. As you can see I’ve changed the page title to “My Membership” (per my client’s request)
Here’s a screenshot of the order detail since it was a ticket purchase:
My goal would be to add another section to the My Account page (the page that is shown in the first screenshot) with a heading “My Events” and list the events they have purchased tickets to with a link to the event page.
Ideally I’d prefer to use action/filter hooks and not have to directly edit the My Account template. I’m already using add_action( ‘woocommerce_after_my_account’, ‘xyz_after_my_account’, 0 ); to display some ACF fields at the bottom of the page (I cropped that out of the screenshot to avoid confusion).
Thanks!
-
AuthorPosts