In this article we will see how to customize the page "No products were found matching your selection”What appears when a search in a shop cu WooCommerce, no results are returned. Specifically, a short guide to WooCommerce Best Practice for optimizing sales and a better experience for potential buyers.
Most topics WordPress optimized for WooCommerce, do not offer administratorstore owners the possibility to customize the page in which no results are displayed following a search on the online store. “No products were found matching your selection"Or"No Products Found".
In such a page where no results are displayed, the potential buyer has no choice but to return to the navigation menu of the site and see are other products that would be interested.
A better optimization for sales would be to provide the user with information about promotions, quick contact information or other products / product categories on this page.
How to customize the page "No products were found matching your selection"In WooCommerce
The PHP file responsible for the page where there are zero results when a product is searched for in an online store with WooCommerceThis no-producs-found.php
Located in wp-content/plugins/woocommerce/templates/loop
and contains the code:
<?php
defined( 'ABSPATH' ) || exit;
?>
<p class="woocommerce-info"><?php esc_html_e( 'No products were found matching your selection.', 'woocommerce' ); ?></p>
From what can be seen, this file also contains the text that appears on the "No Products Found" page. This text differs from one language to another, if the online store is set in a language supported by WooCommerce.
If we want to change the content of the page "No Products Found", The best method is to make a clone of this file in the active theme folder: /themes/active_theme/woocommerce/templates/loop
/no-producs-found.php
. Thus a update al WooCommerce it will not remove the changes made.
After this step, we can proceed as we wish to edit the file no-products-found.php
.
It is preferable to use shortcodes, especially if the theme allows "UX Blocks", such as Flatsome, or "HTML Blocks" as in the case of WoodMart and other themes WooCommerce.
My favorite method was to replace the code:
<p class="woocommerce-info"><?php esc_html_e( 'No products were found matching your selection.', 'woocommerce' ); ?></p>
with a shortcode to an HTML block in which to add banners, products, product categories. Thus, if this page is reached, the potential buyer will be attracted to the products and promotions from the online store.
<?php echo do_shortcode('[block id="search"]'); ?>
Where [block id="search"]
represents a shortcode on a custom HTML page.
Next, I will publish a few more things WooCommerce – Best Practice, which we have successfully applied to several online stores.
1 thought on "How to customize the page "No products were found matching your selection" in WooCommerce - Optimizing Sales on Online Stores"