Skip to content

Instantly share code, notes, and snippets.

View hadamlenz's full-sized avatar

H. Adam Lenz hadamlenz

  • UNC Chapel Hill
  • Durham, NC.
View GitHub Profile
@theeventscalendar
theeventscalendar / add-event-title.php
Last active July 3, 2023 22:47 — forked from geoffgraham/gist:145f929f4547bb2c690e
Add event title to cart next to ticket name
<?php
/**
* Example for adding event data to WooCommerce checkout for Events Calendar tickets.
* @link http://theeventscalendar.com/support/forums/topic/event-title-and-date-in-cart/
*/
add_filter( 'woocommerce_cart_item_name', 'woocommerce_cart_item_name_event_title', 10, 3 );
function woocommerce_cart_item_name_event_title( $title, $values, $cart_item_key ) {
$ticket_meta = get_post_meta( $values['product_id'] );
$event_id = absint( $ticket_meta['_tribe_wooticket_for_event'][0] );