Woocommerce Order Received/Thank You Page – Help
-
I am wanting to put the customers name & personalize it, also I am using the plugin Snippet’s and that is where I put it. I seen in this forum a post from a couple years ago a link you all had listed (https://www.tychesoftwares.com/how-to-customize-the-woocommerce-thank-you-page/). It listed this css:
<?php add_filter( 'the_title', 'woo_personalize_order_received_title', 10, 2 ); function woo_personalize_order_received_title( $title, $id ) { if ( is_order_received_page() && get_the_ID() === $id ) { global $wp; // Get the order. Line 9 to 17 are present in order_received() in includes/shortcodes/class-wc-shortcode-checkout.php file $order_id = apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) ); $order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) ); if ( $order_id > 0 ) { $order = wc_get_order( $order_id ); if ( $order->get_order_key() != $order_key ) { $order = false; } } if ( isset ( $order ) ) { //$title = sprintf( "You are awesome, %s!", esc_html( $order->billing_first_name ) ); // use this for WooCommerce versions older then v2.7 $title = sprintf( "You are awesome, %s!", esc_html( $order->get_billing_first_name() ) ); } } return $title; } add_filter('woocommerce_thankyou_order_received_text', 'woo_change_order_received_text', 10, 2 ); function woo_change_order_received_text( $str, $order ) { $new_str = $str . ' We have emailed the purchase receipt to you.'; return $new_str; }
Here is the way it said it will show: https://cdn2.tychesoftwares.com/wp-content/uploads/2017/05/14070456/woocommerce_change_thank_you_text.png
I put this code in the plugin Snippets and here is what I get:
There is no customers name like it says it would, it is not reading any of the top code. It is only recognizing the bottom one (Thank you. Your order has been received. We have emailed the purchase receipt to you.). How can I get my Order Received Thank You Page to look like what they show ?
- The topic ‘Woocommerce Order Received/Thank You Page – Help’ is closed to new replies.