Yes, you can redirect users to a custom thank you page (but please note all your ecommerce Google Analytics tracking will be skipped…). Yes, you can add content to the default thank you page, for example a Twitter “share your purchase” box. And yes, you can even “include” content from another WordPress page!
Basically, in this article, you will see how to write custom content for your WooCommerce Thank You page as a separate WordPress Page, so that you can use WYSIWYG, Gutenberg or a page builder to create something unique, and then ask WooCommerce to “get it” and “include” such page inside the default order-received endpoint.
If you’re not sure what I mean, try taking a look at the two screenshots below. Then, copy the simple snippet and see the result!
PHP Snippet: Include Custom WordPress Page @ WooCommerce Thank You Page
/**
* @snippet Include WP Page @ WC Thank You
* @how-to Get tutoraspire.com FREE
* @author Tutor Aspire
* @testedwith WooCommerce 3.8
* @donate $9 https://tutoraspire.com
*/
add_action( 'woocommerce_thankyou', 'tutoraspire_custom_thank_you_page', 5 );
function tutoraspire_custom_thank_you_page() {
$page_id = 540;
$page_object = get_post( $page_id );
echo $page_object->post_content;
}