Reputation: 51
How to change the text "Your order" on the checkout in Woocommerce Checkout from the online shop
Upvotes: 1
Views: 11193
Reputation: 1
This absolutely worked when using woocommerce as a quote cart rather than a direct sales cart. saved loads of time working through the site catching functions and rewriting them.
Using the (get text) method.
This still works in 2021 on the latest versions of both wordpress and woocommerce.
Woocommerce 5.1.0 Wordpress 5.6.2
Implemented using the snippets plugin so no child theme required. (available in plugin repository but the plugin page is: https://github.com/sheabunge/code-snippets
Upvotes: 0
Reputation: 495
There are a couple of ways. You can use gettext. As far as I can recall, the term you mentioned is translatable. If so, you can go ahead with the following function. Add this in your theme functions.php
file (child theme recommended)
function custom_wc_translations($translated){
$text = array(
'Your order' => 'Your new phrase',
'any other string' => 'New string',
);
$translated = str_ireplace( array_keys($text), $text, $translated );
return $translated;
}
add_filter( 'gettext', 'custom_wc_translations', 20 );
Alternatively, you can take help of jQuery. I am assuming that particular string is wrapped in an element with a class or ID
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('#your_my_order_element_id').html('Your New string');
//$('.your_my_order_element_class').html('Your New string');
});
})(jQuery);
</script>
Upvotes: 8
Reputation: 49
Check sting Your order in your WooCommerce or theme languagefile under wp-content/languages
If you are using WPML then you can find that string in WPML > String Translations.
Upvotes: 0