问题描述
在WooCommerce中,我有一个Woocommerce网站,并且在客户的最近订单页面上,此示例链接上有一个表,其中包含订单详细信息: https://example.com/my-account/view-order/
In WooCommerce, I have a Woocommerce site and on the customer's recent orders page, there is a table with order details on this example link: https://example.com/my-account/view-order/
如果可能的话,我想从表格中完全隐藏订单状态.
I would like to completely hide order status from the table if possible.
我该如何实现?
谢谢
推荐答案
已更新:
只需使用连接到 woocommerce_my_account_my_orders_columns
过滤器挂钩的自定义函数即可:
Just use this custom function hooked in woocommerce_my_account_my_orders_columns
filter hook:
add_filter('woocommerce_my_account_my_orders_columns', 'custom_removing_order_status', 10, 1);
function custom_removing_order_status( $order ){
unset($order['order-status']);
return $order;
}
代码会出现在您活动的子主题(或主题)的function.php文件或任何插件文件中.
无需编辑woocommerce模板.此代码已经过测试并且可以正常工作.
No need of editing woocommerce templates. This code is tested and works.
这篇关于隐藏“我的帐户最近的订单"列表页面中的订单状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!