Display items exclude a specific id in orders account page WooCoomers?

Question

I try to display exclude a specific product on orders my account page woo-commerce because that product actually is not a real product, I just use it for a gateway of a plugin, so I don’t want it shows on the orders page.

I have tried this:

add_filter( 'woocommerce_my_account_my_orders_query', 'custom_my_orders_query' );
function custom_my_orders_query($args){
    $product_id = 146;
    $args['post__not_in'] = $product_id;
    return $args;
}

But it didn’t work, Can someone help me modify this code?

0
Nicholas Lee 2 years 2020-12-25T02:10:23-05:00 0 Answers 4 views 0

Leave an answer

Browse
Browse