nevercrox.com

WooCommerce Replace “Thank You. Your Order Has Been Received” Text.

Pre-Requisites

There are no pre-requisites for this code snippet to work. Keep in mind this solution consists of two code snippets, one to display the content and one to style it.

How To Implement This Solution?

Add these two code snippets as separate entries in either your active child theme’s functions.php file or the Code Snippets plugin.

About The Snippet

Customizing the introductory message on the WooCommerce Thank You page (order received endpoint) can significantly improve the customer experience. By simply including the customer’s first name, you can make the text feel more personal. If your WooCommerce site handles bookings, service appointments, or event sales, the standard “Thank you. Your order has been received” might seem out of place. This brief guide will show you how to insert the customer’s first name into the intro text and completely modify the text without needing to edit the template files, which we strongly advise against.
Code Snippet 1 (Paste This Code In functions.php or Code Snippets )
/**
* Snippet Name:     Change thank you page intro text on the WooCommerce Thank You Page.
* Snippet Author:   Nevercrox Solutions
*/

add_filter( 'woocommerce_thankyou_order_received_text', 'nevercrox_thank_you_intro_text', 20, 2 );
function nevercrox_thank_you_intro_text( $thank_you_title, $order ){
    return '
Relax ' . $order->get_billing_first_name() . ', you\'ve secured your spa booking!'; }

Just Added Blogs

Need A Specifc Blog ?

Request A Blog

Check Out More Related Snippets