Aya*_*ize 5

有两种方法。您可以使用gettext。据我所记得,您提到的术语是可翻译的。如果是这样,您可以继续以下功能。将此添加到主题functions.php文件中(建议使用子主题)

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 );
Run Code Online (Sandbox Code Playgroud)

或者,您可以使用jQuery。我假设特定字符串包装在具有类或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>
Run Code Online (Sandbox Code Playgroud)

  • +1用于`gettext()`方法。我认为jQuery方法不是一个好主意。最好覆盖`checkout / form-checkout.php`模板。 (2认同)