Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'wcfm_orders_additional_info_column_label', function( $column_label ) {
- if(wcfm_is_vendor()) return 'My earning';
- return "Vendor's earning";
- });
- add_filter( 'wcfm_orders_additonal_data_hidden', '__return_false' );
- add_filter( 'wcfm_orders_additonal_data', function( $column_data, $order_id ) {
- global $WCFM;
- $the_order = wc_get_order( $order_id );
- if ( ! is_a( $the_order, 'WC_Order' ) )
- return __( 'N/A', 'wc-frontend-manager' );
- $order_status = sanitize_title( $the_order->get_status() );
- $order_currency = $the_order->get_currency();
- $commission = $WCFM->wcfm_vendor_support->wcfm_get_commission_by_order( $order_id );
- if ( ! $commission || in_array( $order_status, array( 'failed', 'cancelled', 'refunded', 'request', 'proposal', 'proposal-sent', 'proposal-expired', 'proposal-rejected', 'proposal-canceled', 'proposal-accepted' ) ) ) {
- return __( 'N/A', 'wc-frontend-manager' );
- }
- return wc_price( $commission, array( 'currency' => $order_currency ) );
- }, 50, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement