Skip to content

Instantly share code, notes, and snippets.

@vishalck
Last active November 5, 2018 16:55
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save vishalck/c761f1c60047d2a83262fd1cc95b0612 to your computer and use it in GitHub Desktop.
Change Text on Order Received page in WooCommerce
<?php
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;
}
@truexPoland
Copy link

Hey, should I add this piece of code to the thankyou.php file or should I create a new file named woocommerce-change-order-received-text.php? What do I need to do to ensure the text is changes and displayed correctly at checkout page? Thank you

@truexPoland
Copy link

order translate

@truexPoland
Copy link

I somehow cannot translate this part. I used loco translate and it did work magic but this part somehow cannot be translated :(

@rtpHarry
Copy link

rtpHarry commented Mar 8, 2018

@truexPoland the snippet should have gone in your functions.php inside your theme (or better - a child theme)

@ashokrane
Copy link

@truexPoland You need to copy this code in the functions.php of your child theme. Are you saying you are unable to translate the message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment