1

I'm using woocommerce advance cod plugin for adding an extra charge when selecting COD option and also using dokan plugin for multi selling capabilities in a single wordpress site. My question is : how can I include the extra cod charge (which is being added by wp advanced cod plugin) into $extra_cost from dokan plugin. So that when the seller percentage is being calculated in dokan plugin, it takes only the product price and the percentage is calculated upon it.

This is how dokan calculates seller account percentage:

$order_total    = $order->get_total();
$order_shipping = $order->get_total_shipping();
$order_tax      = $order->get_total_tax();
$extra_cost     = $order_shipping + $order_tax;
$order_cost     = $order_total - $extra_cost;
$order_status   = $order->post_status;

$net_amount     = ( ( $order_cost * $percentage ) / 100 );
$net_amount     = apply_filters( 'dokan_order_net_amount', $net_amount, $order );

and this is how wp advanced cod plugin is written to add extra charge for cod:

$form_fields['extra_charges'] = array(
                        'title'         => __('Extra charges','askoracle'),
                        'type'          => 'text',
                        'description'   => __('Extra charges applied on checkout while select COD payment method','askoracle'),
                        'default'       => '0',
                        'desc_tip'      => '0',
                    );

Waiting for the right answer

0 Answers0