问题
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.
How can I achieve this?
Thanks
回答1:
Updated:
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;
}
Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
No need of editing woocommerce templates. This code is tested and works.
回答2:
You can customize woocommerce/templates/myaccount/my-orders.php template to your theme file.
You will see a variable named "$my_orders_columns". Just remove order-status column from there.
Also, remove it from "$customer_orders" variable, so that it will not unnecessary query to get status.
来源:https://stackoverflow.com/questions/43392110/hiding-order-status-in-my-account-recent-orders-list-page