更改“无产品"Woocommerce 中的消息 [英] Change "No Product" message in Woocommerce
本文介绍了更改“无产品"Woocommerce 中的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在第一个 Woocommerce 页面上遇到了问题.我在商店没有任何产品.出于这个原因,Woocommerce 在第一页上显示无产品"消息.现在我想更改此消息.我该怎么做?
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?
店铺地址:http://shahroodantenna.ir/shop/
推荐答案
尝试以下操作,您可以在其中自定义无产品"消息:
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 );
代码位于活动子主题(或活动主题)的 function.php 文件中.经测试有效.
Code goes in function.php file of your active child theme (or active theme). Tested and works.
这篇关于更改“无产品"Woocommerce 中的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文