改变"没有产品" Woocommerce中的消息

时间:2018-05-04 14:17:31

标签: php wordpress woocommerce product messages

我在第一个Woocommerce页面遇到了问题。我在商店里没有任何产品。出于这个原因,Woocommerce显示"没有产品"第一页上的消息。现在我想改变这个消息。我该怎么做?

enter image description here

店铺地址:http://shahroodantenna.ir/shop/

3 个答案:

答案 0 :(得分:4)

尝试以下操作,您可以自定义"无产品"消息:

$GLOBALS['TCA']['pages_language_overlay']['columns']['title']['l10n_mode'] = 'exclude';

代码放在活动子主题(或活动主题)的function.php文件中。经过测试和工作。

答案 1 :(得分:1)

您好,您可以通过两种方式实现这一目标:

  1. 覆盖您孩子主题的no-products-foun2模板(参见:https://docs.woocommerce.com/document/template-structure/ - https://woocommerce.com/2015/12/site-search-nothing-found/

  2. (更简单)使用“Say What”插件 - https://wordpress.org/plugins/say-what/ - 它允许您用所需的文本替换所需的字符串

  3. 使用第二个选项,您只能自定义副本。与第一个一起,您可以更自由地插入图片,搜索表单等...

答案 2 :(得分:0)

将文件:/plugins/woocommerce/templates/loop/no-products-found.php 复制到 yourtheme/woocommerce/loop/no-products-found.php 并根据需要进行更改。