Home › Forums › Calendar Products › Events Calendar PRO › Adding Event Date to Woocommerce
- This topic has 5 replies, 4 voices, and was last updated 9 years, 9 months ago by
Sheldon.
-
AuthorPosts
-
July 15, 2016 at 9:24 am #1140322
Sheldon
ParticipantHi There,
We’ve almost completed setup of our site with Events Calendar PRO, Tickets PRO and Woocommerce checkout. This is for a comedy club website, where there are 1 – 2 shows per day, with differing ticket prices per show.
Everything is setup correctly and we have the showtime and price setup for each individual ticket offered per daily event, however when I click on a ticket and continue into the WooCommerce flow, it only displays the showtime and price for the ticket, but not the event date. http://d.pr/i/1cGqa
This is problematic as the user clicks into their cart, but might not be sure what tickets are for what nights: http://d.pr/i/12gZK
I know I could probably add the date to the ticket description for each ticket, but I’m wondering if there is an easier way to get this date into the templates, from a code perspective. I also know you probably don’t provide much support on the WooCommerce side, but any direction / help would be appreciated!
Thanks.
July 18, 2016 at 7:27 am #1141012Nico
MemberHi Sheldon,
Thanks for reaching out to us! Interesting question, as you already know we cannot provide much support on the Woo side of things but we can give this a try ๐
Try pasting this snippet in your functions.php file:
/* Add event date to Woo Cart */
function tribe_show_event_date_cart ( $item_data, $cart_item ) {if ( ! class_exists('Tribe__Tickets_Plus__Commerce__WooCommerce__Main') ) return $item_data;
$tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
$event_id = get_post_meta( $cart_item['product_id'], $tickets->event_key, true );
if ( ! empty( $event_id ) ) {
$item_data[] = array(
'key' => 'Date',
'value' => tribe_get_start_time ( $event_id, tribe_get_date_format() )
);
}return $item_data;
}add_filter ( 'woocommerce_get_item_data', 'tribe_show_event_date_cart', 10, 2 );
Also, please note that tickets still don’t support recurring events!
Please let me know if the snippet works as expected,
Best,
NicoJuly 18, 2016 at 3:54 pm #1141247Sheldon
ParticipantThis reply is private.
July 18, 2016 at 6:27 pm #1141276Nico
MemberWooot! Stocked to hear Sheldon ๐
Iโll go ahead and close out this thread, but if you need help with anything else please donโt hesitate to create a new one and we will be happy to assist you.
Hope you have a great week,
NicoAugust 9, 2016 at 9:35 am #1149529Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Adding Event Date to Woocommerce’ is closed to new replies.
