Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

commented Jan 18, 2018

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

This comment has been minimized.

Copy link

commented Jan 18, 2018

order translate

@truexPoland

This comment has been minimized.

Copy link

commented Jan 18, 2018

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

@rtpHarry

This comment has been minimized.

Copy link

commented Mar 8, 2018

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

@ashokrane

This comment has been minimized.

Copy link

commented Apr 26, 2018

@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
You can’t perform that action at this time.