Change "No Product" message in Woocommerce
Solution 1
Try the following, where you can customize the "No Product" message:
add_action( 'woocommerce_no_products_found', function(){
remove_action( 'woocommerce_no_products_found', 'wc_no_products_found', 10 );
// HERE change your message below
$message = __( 'No products were found matching your selection.', 'woocommerce' );
echo '<p class="woocommerce-info">' . $message .'</p>';
}, 9 );
Code goes in function.php file of your active child theme (or active theme). Tested and works.
Solution 2
Hi you could achieve this in two ways:
overriding the no-products-foun2 template on your child theme (see: https://docs.woocommerce.com/document/template-structure/ - https://woocommerce.com/2015/12/site-search-nothing-found/)
(easier) use "Say What" plugin - https://wordpress.org/plugins/say-what/ - It allows you to replace the desired string with the text you desire
With the second option, you can customize only the copy. Going with the first one, you have more freedom to insert pictures, a search form, etc...
Related videos on Youtube
SaeedHasani
Updated on June 04, 2022Comments
-
SaeedHasani almost 2 years
I have the problem at the first Woocommerce page. I don't have any product at the shop. For this reason, Woocommerce shows "No Products" message on the first page. Now I want to change this message. How do I do this?
Shop address: http://shahroodantenna.ir/shop/
-
Zanam over 3 yearsDoes this still work in 2021? I tried it but it doesn't.
-
LoicTheAztec over 3 years@Zanam Just tested that on WooCommerce last version and it still works perfectly… See this screenshot
-
Chad Reitsma over 2 yearsWhy not just change the template? /templates/loop/no-products-found.php