问题
How to change the text "Your order" on the checkout in Woocommerce Checkout from the online shop
回答1:
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>
回答2:
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.
来源:https://stackoverflow.com/questions/44216196/how-to-change-the-text-your-order-on-the-checkout