Forum Replies Created
-
AuthorPosts
-
Brian
ParticipantGeoff,
Thank you for following up with me. To answer your questions, yes I have made template customizations and yes I followed the steps when upgrading from past versions of the plugin. I’ve done some more troubleshooting and found the cause of my issue. I added a ‘woocommerce_order_item_name’ filter shown below which was causing the issue.
/** * Add event title to order line item. */ add_filter( 'woocommerce_order_item_name', 'sq_woocommerce_order_item_name', 10, 2 ); function sq_woocommerce_order_item_name( $name, $item ) { $tribe = new Tribe__Tickets_Plus__Commerce__WooCommerce__Main(); $event_id = get_post_meta( $item['product_id'], $tribe->event_key, true ); get_the_title( $item['product_id'] ); get_permalink( $item['product_id'] ); if ( tribe_events_has_tickets( $event_id ) ) { $link = get_permalink( $event_id ); $event_date = tribe_get_start_date( $event_id, $display_time = true, 'M j \a\t g:ia' ); $name = $name . ' for <a href="' . $link . '">' . get_the_title( $event_id ) . '</a> - ' . $event_date; } return $name; }When I didn’t call get_the_title( $item[‘product_id’] ); before if ( tribe_events_has_tickets( $event_id ) ) The name it was returning was “Order Received”. Clearly this wasn’t the correct approach so I’ve updated my code to get the event title the proper way:
/** * Add event title to order line item. */ add_filter( 'woocommerce_order_item_name', 'sq_woocommerce_order_item_name', 10, 2 ); function sq_woocommerce_order_item_name( $name, $item ) { $event = tribe_events_get_ticket_event( $item['product_id'] ); if ( $event ) { $link = get_permalink( $event->ID ); $event_date = tribe_get_start_date( $event->ID, $display_time = true, 'M j \a\t g:ia' ); $name = $name . ' for <a href="' . $link . '">' . $event->post_title . '</a> - ' . $event_date; } return $name; }Just posting this info here incase anyone else encounters a similar issue.
Thanks for the support!Brian
ParticipantThis reply is private.
Brian
ParticipantHi George,
Thanks for the kudos & swift response. I went ahead and purchased the plugins and started some testing over the weekend. I really like what you guys have put together, seems to be amongst the best in this category for WordPress.
I may be getting out of the scope of the pre-sales forum, but to continue my original question, I came across this thread which seems to be a solution to accomplish exactly my goal. I know I originally asked for a simple solution, but I’m very comfortable with php & Drupal, just not so much WordPress. My question/concern is the thread referenced above is modifying one of the core plugin files, which has always been a big no-no in other environments? Is there a smarter/safer way to make such a modification and what are your teams thoughts on performing such a modification?
-
AuthorPosts
