WCMp Advanced Frontend Manager
Tagged: Commissions, earnings, shipping
-
AuthorPosts
-
-
November 16, 2022 at 2:08 AM #146251igParticipant
How can we add commission and shipping columns to the Orders table on the vendor dashboard …/dashboard/vendor-orders/ ?
Earnings column shows the total of commission + shipping, we want to split this value because we charge vendor a commission and customer pays shipping cost directly to the courier service.
We’ve enabled option in the plugin settings: If enabled vendor can configure their shipping on dashboard. Our commission type is percentage, commission value 85%
-
November 16, 2022 at 6:03 PM #146277promitaKeymaster
Hi Ivan Gacesa, In order to add commission and shipping columns to the Orders table on the vendor dashboard, add this code in functions.php of your child theme :
/* add additional column in vendor order table */ add_filter('mvx_datatable_order_list_table_headers', 'add_column_in_order_table_vendor', 10, 2); function add_column_in_order_table_vendor($orders_list_table_headers, $current_user_id) { $orders_list_table_headers['commission'] = array('label' => __( 'Commission', 'multivendorx' )); $orders_list_table_headers['shipping_charge'] = array('label' => __( 'Shipping', 'multivendorx' )); return $orders_list_table_headers; } /* display value in additional column in vendor order table */ add_filter('mvx_datatable_order_list_row', 'display_value_in_order_table_vendor', 10, 2); function display_value_in_order_table_vendor($vendor_rows, $order) { $commission_id = get_post_meta($order->get_id(), '_commission_id', true); $commission_amount = get_post_meta( $commission_id, '_commission_amount', true ); $vendor_rows['shipping_charge'] = $order->get_shipping_total(); $vendor_rows['commission'] = $commission_amount; return $vendor_rows; }
CopyLet us know if you have any further query.
-
November 18, 2022 at 5:00 PM #146390igParticipant
Thanks promita,
It works with multivendorX, but we had to downgrade to WC-marketplace 3.9.3 because multiVendorX has a lot of problems with settings which is not migrated from wcmp to multivendorX (payment, store front etc.) and your plugins Advanced Frontend Manager, WCMp Advanced Vendor Report, Loco translate and all wcmp custom snippets, css. I will add another post for it.
Can you change snippet code for commission and shipping columns for the last WC marketplace 3.9.3?
Thanks in advance
-
November 18, 2022 at 5:55 PM #146391promitaKeymaster
Hi Ivan Gacesa, In WC-marketplace 3.9.3, add this code in functions.php of your child theme :
/* add additional column in vendor order table */ add_filter('wcmp_datatable_order_list_table_headers', 'add_column_in_order_table_vendor', 10, 2); function add_column_in_order_table_vendor($orders_list_table_headers, $current_user_id) { $orders_list_table_headers['commission'] = array('label' => __( 'Commission', 'multivendorx' )); $orders_list_table_headers['shipping_charge'] = array('label' => __( 'Shipping', 'multivendorx' )); return $orders_list_table_headers; } /* display value in additional column in vendor order table */ add_filter('wcmp_datatable_order_list_row_data', 'display_value_in_order_table_vendor', 10, 2); function display_value_in_order_table_vendor($vendor_rows, $order) { $commission_id = get_post_meta($order->get_id(), '_commission_id', true); $commission_amount = get_post_meta( $commission_id, '_commission_amount', true ); $vendor_rows['shipping_charge'] = $order->get_shipping_total(); $vendor_rows['commission'] = $commission_amount; return $vendor_rows; }
CopyLet us know if you have any further query.
-
November 18, 2022 at 6:44 PM #146393igParticipant
Thanks, it works.
How can we change the order of the columns, move columns commission and shipping before earnings (3rd and 4th position)?
-
November 18, 2022 at 7:28 PM #146401NerdySupportExpert MoumitaKeymaster
@ig, our team will assit you with this.
In the mean time, We would love it if you shared your experience by giving us 5/5 review here : https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/#new-post
-
November 21, 2022 at 5:38 PM #146510promitaKeymaster
@ig, In order to change the order of the columns, you can override the vendor-orders.php file to your theme and change line no- 17-24 of this code:
$orders_list_table_headers = apply_filters('wcmp_datatable_order_list_table_headers', array( 'select_order' => array('label' => '', 'class' => 'text-center'), 'order_id' => array('label' => __( 'Order ID', 'dc-woocommerce-multi-vendor' )), 'order_date' => array('label' => __( 'Date', 'dc-woocommerce-multi-vendor' )), 'commission' => array('label' => __( 'Commission', 'dc-woocommerce-multi-vendor' )), 'shipping_charge' => array('label' => __( 'Shipping', 'dc-woocommerce-multi-vendor' )), 'vendor_earning'=> array('label' => __( 'Earnings', 'dc-woocommerce-multi-vendor' )), 'order_status' => array('label' => __( 'Status', 'dc-woocommerce-multi-vendor' )), 'action' => array('label' => __( 'Action', 'dc-woocommerce-multi-vendor' )), ), get_current_user_id());
Copyand add this code in functions.php of your child theme :
/* display value in additional column in vendor order table */ add_filter('wcmp_datatable_order_list_row_data', 'display_value_in_order_table_vendor', 10, 2); function display_value_in_order_table_vendor($vendor_rows, $order) { $commission_id = get_post_meta($order->get_id(), '_commission_id', true); $commission_amount = get_post_meta( $commission_id, '_commission_amount', true ); $vendor_rows['shipping_charge'] = $order->get_shipping_total(); $vendor_rows['commission'] = $commission_amount; return $vendor_rows; }
CopyLet us know if you have any further query.
-
November 22, 2022 at 4:19 PM #146576
-
-
AuthorPosts
The topic ‘Orders table, earnings, commissions and shipping cost’ is closed to new replies.