Display product earnings in admin order backend
-
Hello,
We know that dokan saves the earnings per product in meta value
_dokan_commission_type
and_dokan_commission_rate
. We want to display them under each product row in the admin backend order overview.This is our code, but it displays nothing.
How we have to do that?
function display_product_vendor_earnings( $item, $cart_item_key, $values, $order ) { if( isset( $values['_dokan_commission_rate'] ) ) { $item->add_meta_data( __( 'Earning per product', 'WooCommerce' ), $values['_dokan_commission_rate'], true ); } } add_action( 'woocommerce_checkout_create_order_line_item', 'display_product_vendor_earnings', 10, 4 );
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Display product earnings in admin order backend’ is closed to new replies.