![](https://www.wp-centrics.com/wp-content/uploads/customize-woocommerce-cart-messages.jpg)
In this post, we will see what are the WooCommerce Cart Messages, when and where it shown, and why you might want to customize Cart Messages in WooCommerce, and how to do it.
In WooCommerce, shipping methods are an essential part of the checkout process. Customers need to know what shipping options are available and how much they will cost. However, there are times when there may be no available shipping options for a particular customer or order.
When a customer tries to check out with products in their cart, they might encounter a situation where there are no available shipping methods for their location or the products they’ve selected. This can be frustrating for the customer, as they may not understand why they can’t proceed with their purchase.
In this case, it’s helpful to customize the WooCommerce cart messages to provide clear information to the customer about why there are no shipping options available, and what they can do to resolve the issue. By providing helpful messaging, you can reduce customer frustration and improve the overall shopping experience on your site.
Table of Contents
Reasons for the “not available shipping methods” aka WooCommerce Cart Messages:
- The customer haven’t entered yet his address (and our WooCommerce settings does not set any by default)
- The customer’s location is not serviced by any of the available shipping methods.
- The customer has selected items that are not able to be shipped or require special shipping arrangements.
- The weight or size of the items in the customer’s cart exceeds the limitations of the available shipping methods.
When any of these scenarios occur, the customer needs to be informed of the issue and provided with guidance on how to proceed. This is where the WooCommerce Cart Messages come into play. These messages are designed to inform the customer about the status of their shipping options and provide guidance on what to do next.
The four WooCommerce Cart Messages
Here are the four messages you might encounter when there are no available shipping methods in WooCommerce, and when each message is displayed:
- “Shipping costs are calculated during checkout” – This message is displayed in the cart page only, when a customer hasn’t entered their shipping address yet and you have the WooCommerce setting of “Enable shipping calculator on the cart page” disabled. It’s a reminder to the customer that shipping costs will be calculated during the checkout process.
- “Enter your address to view shipping options.” – This message is displayed in the cart or checkout pages, when a customer hasn’t entered their shipping address yet, and if you are on cart, you have the shipping calculator enabled, unlike the previous case. It prompts the customer to enter their address so that shipping options can be displayed.
- “No shipping options were found for %s.” – This message is displayed on the cart page only, when there are no available shipping methods available and the shipping address has entered. The “%s” variable is replaced with the formatted destination (may be different due the country)
- “There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help.” – This message is displayed in the checkout page only, when there are no available shipping methods for the customer’s address. It informs the customer that there are no shipping options available and should provide a suggestion on how to proceed, as our customer can’t advance at this point.
How to customize WooCommerce Cart Messages programmatically
As you can seen in the WooCommerce template /cart/cart-shipping.php, or maybe override in your theme (under the path: your-theme/woocommerce/cart/cart-shipping.php), the four messages are filtered before printing, so we can hook and replace them:
Here is the code. You can add it to your functions.php file on your theme, or add it to a custom plugin:
add_filter( 'woocommerce_shipping_not_enabled_on_cart_html', 'custom_not_shipping_on_cart' );
function custom_not_shipping_on_cart( $ message ) {
/* Default message: Shipping costs are calculated during checkout. */
return 'Please, go to checkout to see the shipping costs.';
}
add_filter( 'woocommerce_shipping_may_be_available_html', 'custom_shipping_calculated_message' );
function custom_shipping_calculated_message( $ message ) {
/* Default message: Enter your address to view shipping options. */
return 'Please, enter your address here to view shipping options.';
}
add_filter( 'woocommerce_cart_no_shipping_available_html', 'custom_no_shipping_message', 10, 2 );
function custom_no_shipping_message( $message, $formatted_destination ) {
/* Default message: No shipping options were found for %s.*/
$message = sprintf( We currently do not ship to your location: %s. Please contact customer support for assistance', $formatted_destination );
return $message;
}
add_filter( 'woocommerce_no_shipping_available_html', 'custom_shipping_calculated_message' );
function custom_shipping_calculated_message( $ message ) {
/* Default message: There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help. */
return 'Enter your address to view shipping options and calculate shipping costs.';
}
Customize Cart Messages in WooCommerce with Fish and Ships: contextual, conditional, and easy as child’s play
the functions above are fully functional. You can use them. But the key is to modify these messages in a conditional way, informing our customer exactly what he has to do in order to place the order
And this is where the new Fish and Ships special action appears: “Change cart totals messages”. You can set this action in any shipping rule, or in several of them, thus modifying the messages in a conditional and, even better, contextual way: each rule can set different messages if it is fulfilled (typically, exclusion rules, accompanied by the special action “abort shipping method” or “hide other shipping methods”).
For example, we can set a minimum basket price for shipping, and set messages that say exactly this:
![Set a conditional rule and add the special action for customize Cart Messages in WooCommerce](https://www.wp-centrics.com/wp-content/uploads/customize-cart-messages-in-woocommerce.jpg)
![Set the new messages to customise Cart Messages in WooCommerce](https://www.wp-centrics.com/wp-content/uploads/customize-woocommerce-cart-messages.jpg)
![The customised message on WooCommerce Cart Messages](https://www.wp-centrics.com/wp-content/uploads/the-custom-cart-message-in-woocommerce.jpg)
Customize Cart Messages in WooCommerce is only available in Fish and Ships Pro. You can use it together with all the other powerful features. Here you can compare the two versions: Free & Pro.