Untitled

 avatar
unknown
plain_text
2 years ago
430 B
5
Indexable
add_filter('marketking_vendor_commission_change', function($commission, $vendor_id, $order_id){
    if (get_post_meta($order_id,'_salesking_calculated_earnings', true) === 'yes'){
        $earning_id = get_post_meta($order_id,'salesking_earning_id', true);
        $agent_commission = get_post_meta($earning_id,'salesking_commission_total', true);
        $commission -= $agent_commission;
    }
    return $commission;
}, 10, 3);
Editor is loading...