Remove Random Orders Metas from Vendor Dash

This snippet is will allow you to hide any unwanted order meta data inside the single order page of the Vendor Dashboard. I’ve found that some things work and some things don’t, depending on the source. If you have any thoughts please comment below.

As always, this is either added to your Child Theme’s functions.php file, or consider using the My Custom Functions Pro plugin to manage and organize all your snippets.

add_filter( 'wcmp_vendor_dash_hidden_order_itemmeta', 'add_hidden_meta_v_dash' , 10 , 3 );
function add_hidden_meta_v_dash ( $hidden_order_itemmeta ) {
   $hidden_order_itemmeta = array(
       '_qty',
       '_tax_class',
       '_product_id',
       '_variation_id',
       '_line_subtotal',
       '_line_subtotal_tax',
       '_line_total',
       '_line_tax',
       'method_id',
       '_vendor_item_commission',
       'cost',
       'commission',
       '_vendor_id',
       'vendor_id',
       '_vendor_order_item_id',
       'Sold By',
       '_vendor_order_shipping_item_id',
       'package_qty',
       );
    return $hidden_order_itemmeta;
}

Tested and working on Woocommerce 4.6.1, WCMp 3.5.10

Is this no longer relevant or not working? Please let us know in the comments!

Comments on this post

Your email address will not be published. Required fields are marked *