{"id":1896602,"date":"2019-10-18T13:19:36","date_gmt":"2019-10-18T17:19:36","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/adding-the-event-date-to-woocommerce-order-email\/"},"modified":"2022-05-02T04:02:12","modified_gmt":"2022-05-02T08:02:12","slug":"adding-the-event-date-to-woocommerce-order-email","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/adding-the-event-date-to-woocommerce-order-email\/","title":{"rendered":"Add an Event&#8217;s Date to the WooCommerce Order Email"},"content":{"rendered":"\n<p><strong>Note: This feature is now automatically included with Event Tickets Plus.<\/strong><\/p>\n\n\n\n<p>When a user buys a ticket with Event Tickets Plus, they receive an order confirmation email that describes their purchase. It includes the information you might expect on a typical receipt or invoice\u2014the name of the ticket, the total cost of the order, etc.<\/p>\n\n\n\n<p>By default this email does <strong>not<\/strong> include the date of the event, and many users have asked us if they can change this. Adding the event date to your customers&#8217; order confirmation emails is indeed possible\u2014all you have to do is add a code snippet like the following to your theme&#8217;s <code>functions.php<\/code> file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/**\n * Adds event start date to ticket order titles in email and checkout screens.\n *\n * @return string\n *\/\nfunction tribe_add_date_to_order_title( $title, $item ) {\n\t$event = tribe_events_get_ticket_event( $item&#x5B;'product_id'] );\n\n\tif ( $event !== false ) {\n\t\t$title .= ' - ' . tribe_get_start_date( $event );\n\t}\n\n\treturn $title;\n}\n\nadd_filter( 'woocommerce_order_item_name', 'tribe_add_date_to_order_title', 100, 2 );\n<\/pre><\/div>\n\n\n<p>As an example of the power of this snippet, check out this screenshot of an order confirmation email <em>before<\/em> the above snippet is added:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2016\/05\/Screen-Shot-2016-05-07-at-9.46.04-PM.png\" rel=\"attachment wp-att-1111952\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2016\/05\/Screen-Shot-2016-05-07-at-9.46.04-PM.png\" alt=\"Screenshot\"\/><\/a><\/figure><\/div>\n\n\n\n<p><br>This is how an order confirmation email from Event Tickets Plus looks by default.<\/p>\n\n\n\n<p>This screenshot below, meanwhile, shows how the email looks when the above code snippet is in place on your site:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2016\/05\/Screen-Shot-2016-05-07-at-9.45.53-PM.png\" rel=\"attachment wp-att-1111953\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2016\/05\/Screen-Shot-2016-05-07-at-9.45.53-PM.png\" alt=\"Screenshot\"\/><\/a><\/figure><\/div>\n\n\n\n<p><br>This is how an order confirmation email from Event Tickets Plus looks with the event date added to the order items.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Note: This feature is now automatically included with Event Tickets Plus. When a user buys a ticket with Event Tickets Plus, they receive an order confirmation email that describes their purchase. It includes the information you might expect on a typical receipt or invoice\u2014the name of the ticket, the total cost of the order, etc&#8230;.<\/p>\n","protected":false},"author":3,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[79],"tags":[26,106],"stellar-product-taxonomy":[156],"class_list":["post-1896602","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippets","tag-ecommerce","tag-woocommerce","stellar-product-taxonomy-event-tickets-plus"],"acf":[],"taxonomy_info":{"category":[{"value":79,"label":"Snippets"}],"post_tag":[{"value":26,"label":"Ecommerce"},{"value":106,"label":"WooCommerce"}],"stellar-product-taxonomy":[{"value":156,"label":"Event Tickets Plus"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Jaime Marchwinski","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/jaimetri-be\/"},"comment_info":0,"category_info":[{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":136,"filter":"raw","term_order":"0","cat_ID":79,"category_count":136,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","category_parent":0}],"tag_info":[{"term_id":26,"name":"Ecommerce","slug":"ecommerce","term_group":0,"term_taxonomy_id":26,"taxonomy":"post_tag","description":"","parent":0,"count":18,"filter":"raw","term_order":"0"},{"term_id":106,"name":"WooCommerce","slug":"woocommerce","term_group":0,"term_taxonomy_id":106,"taxonomy":"post_tag","description":"","parent":26,"count":40,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1896602"}],"version-history":[{"count":1,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896602\/revisions"}],"predecessor-version":[{"id":1956216,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896602\/revisions\/1956216"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1896602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1896602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1896602"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1896602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}