Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 从dokan插件卖方百分比计算中删除额外的COD费用_Php_Wordpress_Plugins_Woocommerce_Dokan - Fatal编程技术网

Php 从dokan插件卖方百分比计算中删除额外的COD费用

Php 从dokan插件卖方百分比计算中删除额外的COD费用,php,wordpress,plugins,woocommerce,dokan,Php,Wordpress,Plugins,Woocommerce,Dokan,我使用woocommerce高级cod插件在选择cod选项时增加额外费用,还使用dokan插件在一个wordpress站点中实现多种销售功能。 我的问题是:我如何将额外的cod费用(由wp advanced cod插件添加)计入dokan插件的$extra_成本中。因此,当在dokan插件中计算卖家百分比时,它只取产品价格,并根据产品价格计算百分比 这是dokan计算卖方账户百分比的方式: $order_total = $order->get_total(); $order_ship

我使用woocommerce高级cod插件在选择cod选项时增加额外费用,还使用dokan插件在一个wordpress站点中实现多种销售功能。 我的问题是:我如何将额外的cod费用(由wp advanced cod插件添加)计入dokan插件的$extra_成本中。因此,当在dokan插件中计算卖家百分比时,它只取产品价格,并根据产品价格计算百分比

这是dokan计算卖方账户百分比的方式:

$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 );
这就是wp advanced cod插件如何为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',
                    );
等待正确答案