Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save codeagencybe/8b3a78f54b27a8a03bd35f2a67c74386 to your computer and use it in GitHub Desktop.
Save codeagencybe/8b3a78f54b27a8a03bd35f2a67c74386 to your computer and use it in GitHub Desktop.
Woocommerce change message when no delivery method is available
add_filter( 'woocommerce_cart_no_shipping_available_html', 'ca_message_no_available_shipping_methods', 10, 1 );
add_filter( 'woocommerce_no_shipping_available_html', 'ca_message_no_available_shipping_methods', 10, 1 );
function ca_message_no_available_shipping_methods( $default_msg ) {
$custom_msg = "Unfortunately, our delivery service is available in your location";
if( empty( $custom_msg ) ) {
return $default_msg;
}
return $custom_msg;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment