{"id":1951481,"date":"2021-12-15T10:59:34","date_gmt":"2021-12-15T15:59:34","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/?post_type=tribe-knowledgebase&#038;p=1951481"},"modified":"2024-08-20T16:35:51","modified_gmt":"2024-08-20T20:35:51","slug":"completing-woocommerce-orders","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/completing-woocommerce-orders\/","title":{"rendered":"Automatically Complete WooCommerce Orders for Tickets"},"content":{"rendered":"\n<p>When purchasing tickets with <a href=\"https:\/\/theeventscalendar.com\/products\/wordpress-event-tickets\/\" target=\"_blank\" rel=\"noreferrer noopener\">Event Tickets Plus<\/a> with WooCommerce, emails won&#8217;t be sent to attendees until the order has been marked as <strong>Complete<\/strong>. By default, this process needs to be done manually by the administrator.<\/p>\n\n\n\n<p>Here, we&#8217;ll show you how to make sure that your attendees receive their emails and how you can set this up automatically.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-woocommerce-order-process\">WooCommerce Order Process<\/h2>\n\n\n\n<p>When an attendee purchases a ticket, WooCommerce first sets the order to Pending. The payment gateway then attempts to run the payment method, in which case the order status updates to <strong>On-Hold<\/strong> (or Failed if the payment doesn&#8217;t go through). Next, WooCommerce automatically sets the status to <strong>Processing<\/strong>. And that is where the &#8220;automatic&#8221; process ends.<\/p>\n\n\n\n<p>As the administrator, you&#8217;ll have to set the order to <strong>Completed<\/strong> for the email to your attendee to be triggered. The following diagram may be helpful to get a sense of the order process:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/12\/Screen-Shot-2021-12-15-at-1.49.28-PM.png\" alt=\"WooCommerce order status diagram\" class=\"wp-image-1951482\"\/><\/figure>\n\n\n\n<p>You may also want to reference <a href=\"https:\/\/woocommerce.com\/document\/managing-orders\/\" target=\"_blank\" rel=\"noreferrer noopener\">this article<\/a> from WooCommerce to see some more detailed information about managing WooCommerce orders.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-automatically-set-to-complete\">Automatically Set to Complete<\/h2>\n\n\n\n<p>If you&#8217;d like, you can automatically set the order to <strong>Complete<\/strong> so that an email will be sent to your attendees as soon as their payment method is verified. This will require no further action to complete your ticket orders.<\/p>\n\n\n\n<p>To make this happen, add the following snippet to the site:<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/masoodahmed\/4f615c3624e9b9f13ab3d14868020531.js\"><\/script>\n\n\n\n<p>This code snippet first validates the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Order contains only Ticket products<\/li>\n\n\n\n<li>All Ticket products are virtual<\/li>\n\n\n\n<li>Payment has been processed<\/li>\n<\/ul>\n\n\n\n<p>If all three conditions are met, the order will be marked complete. This rule only applies to orders created for Tickets products using the Event Tickets Plus plugin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-for-developers\">For Developers<\/h2>\n\n\n\n<p>Here are some of the key components used in the code snippet,<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/wp-kama.com\/plugin\/woocommerce\/hook\/woocommerce_thankyou\" target=\"_blank\" rel=\"noreferrer noopener\">woocommerce_thankyou<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.theeventscalendar.com\/reference\/classes\/tribe__tickets_plus__main\/\" target=\"_blank\" rel=\"noreferrer noopener\">Tribe__Tickets_Plus__Main<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/wp-kama.com\/plugin\/woocommerce\/function\/wc_get_order\" target=\"_blank\" rel=\"noreferrer noopener\">wc_get_order<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.theeventscalendar.com\/reference\/functions\/tribe_events_product_is_ticket\/\" target=\"_blank\" rel=\"noreferrer noopener\">tribe_events_product_is_ticket<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>When purchasing tickets with Event Tickets Plus with WooCommerce, emails won&#8217;t be sent to attendees until the order has been marked as Complete. By default, this process needs to be done manually by the administrator. Here, we&#8217;ll show you how to make sure that your attendees receive their emails and how you can set this&#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":[24,46,59,61,79,88],"tags":[25,58,212,106],"stellar-product-taxonomy":[156],"class_list":["post-1951481","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","category-integrations","category-customizing-resources","category-events-features","category-snippets","category-tickets","tag-customizations","tag-php","tag-snippets","tag-woocommerce","stellar-product-taxonomy-event-tickets-plus"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"},{"value":46,"label":"Integrations"},{"value":59,"label":"PHP &amp; Functions"},{"value":61,"label":"Product Features"},{"value":79,"label":"Snippets"},{"value":88,"label":"Ticketing"}],"post_tag":[{"value":25,"label":"Customizations"},{"value":58,"label":"PHP"},{"value":212,"label":"snippets"},{"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":24,"name":"Customizations","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":110,"filter":"raw","term_order":"0","cat_ID":24,"category_count":110,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":46,"name":"Integrations","slug":"integrations","term_group":0,"term_taxonomy_id":46,"taxonomy":"category","description":"","parent":0,"count":115,"filter":"raw","term_order":"0","cat_ID":46,"category_count":115,"category_description":"","cat_name":"Integrations","category_nicename":"integrations","category_parent":0},{"term_id":59,"name":"PHP &amp; Functions","slug":"customizing-resources","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":101,"filter":"raw","term_order":"0","cat_ID":59,"category_count":101,"category_description":"","cat_name":"PHP &amp; Functions","category_nicename":"customizing-resources","category_parent":24},{"term_id":61,"name":"Product Features","slug":"events-features","term_group":0,"term_taxonomy_id":61,"taxonomy":"category","description":"","parent":0,"count":31,"filter":"raw","term_order":"0","cat_ID":61,"category_count":31,"category_description":"","cat_name":"Product Features","category_nicename":"events-features","category_parent":0},{"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},{"term_id":88,"name":"Ticketing","slug":"tickets","term_group":0,"term_taxonomy_id":88,"taxonomy":"category","description":"","parent":61,"count":83,"filter":"raw","term_order":"0","cat_ID":88,"category_count":83,"category_description":"","cat_name":"Ticketing","category_nicename":"tickets","category_parent":61}],"tag_info":[{"term_id":25,"name":"Customizations","slug":"customizations","term_group":0,"term_taxonomy_id":25,"taxonomy":"post_tag","description":"","parent":0,"count":177,"filter":"raw","term_order":"0"},{"term_id":58,"name":"PHP","slug":"php","term_group":0,"term_taxonomy_id":58,"taxonomy":"post_tag","description":"","parent":20,"count":128,"filter":"raw","term_order":"0"},{"term_id":212,"name":"snippets","slug":"snippets","term_group":0,"term_taxonomy_id":212,"taxonomy":"post_tag","description":"","parent":0,"count":17,"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\/1951481","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=1951481"}],"version-history":[{"count":3,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1951481\/revisions"}],"predecessor-version":[{"id":1962623,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1951481\/revisions\/1962623"}],"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=1951481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1951481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1951481"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1951481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}