mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-03 12:12:25 +08:00
https://stackoverflow.com/questions/66048796/change-no-shipping-method-has-been-selected-from-woocommerce-checkout-notice/66050428
12 lines
553 B
Text
12 lines
553 B
Text
add_filter( 'gettext', 'change_checkout_no_shipping_method_text', 10, 3 );
|
|
function change_checkout_no_shipping_method_text( $translated_text, $text, $domain ) {
|
|
if ( is_checkout() && ! is_wc_endpoint_url() ) {
|
|
$original_text = 'No shipping method has been selected. Please double check your address, or contact us if you need any help.';
|
|
$new_text = 'Here your own text replacement.';
|
|
|
|
if ( $text === $original_text ) {
|
|
$translated_text = $new_text;
|
|
}
|
|
}
|
|
return $translated_text;
|
|
}
|