I’m looking for something like this
add_filter( 'woocommerce_product_export_column_names', 'add_export_column' );
add_filter( 'woocommerce_product_export_product_default_columns', 'add_export_column' );
function add_export_column( $columns ) {
$columns['store_id'] = 'Store ID';
$columns['store_name'] = 'Store Name';
return $columns;
}
function add_export_data_store_id( $value, $product ) {
$value = wcfm_get_vendor_id_by_post( $product->get_id() );
return $value;
}
add_filter( 'woocommerce_product_export_product_column_store_id', 'add_export_data_store_id', 10, 2 );
function add_export_data_store_name( $value, $product ) {
$value = wcfm_get_vendor_store_name_by_post( $product->get_id() );
return $value;
}
add_filter( 'woocommerce_product_export_product_column_store_name', 'add_export_data_store_name', 10, 2 );
This works fine when I export products. Can we adapt it to work for orders?
Thanks
D.