Change the error message for unavailable shipping method in WooCommerce

Change the error message for unavailable shipping method in WooCommerce on child sites.

Snippet Type

Execute on Child Sites

Snippet

function change_no_shipping_method_error_text( $error ) {
    if( 'No shipping method has been selected. Please double check your address, or contact us if you need any help.' == $error ) {
        $error = 'New error message';
    }
    return $error;
}
add_filter( 'woocommerce_add_error', 'change_no_shipping_method_error_text' );

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.