Woocommerce没有最近的订单文字

问题描述:

我有woocommerce设置和正常工作,我只是需要一点点调整。Woocommerce没有最近的订单文字

在我的帐户页面上,默认值是最近的订单,显示客户最近的订单。但是,如果没有订单,页面是空白的。 我想添加一行文字来显示页面已加载,并可能鼓励用户创建订单。

我在哪里添加这个到我的订单或我的帐户页面只显示没有其他订单存在?任何帮助赞赏。谢谢。

您可以将my-orders.php模板复制到您的主题(在wp-content/themes/my-theme/woocommerce/myaccount/my-orders.php)。

你会看到这个模板有一个if语句:

if ($customer_orders) : 
// prints the orders table 
endif; 

你只需要给这个声明的else条件,像这样:

if ($customer_orders) : 
// prints the orders table 
else : 
    echo 'please buy some stuff'; 
endif; 
+0

完美。谢谢你的帮助。 – Crease 2014-10-09 07:38:03