在 Dokan 插件的供应商新订单电子邮件中隐藏自定义 Woocommerce 附加费

问题描述

首先,我对 wordpress 自定义还很陌生,我仍在学习。

我已经添加一个自定义代码,以增加运送到选定位置的额外费用,因为我参考了这篇博文 https://www.businessbloomer.com/woocommerce-add-shipping-fee-non-continental-states/

//add additional fee for East Malaysia
add_action( 'woocommerce_cart_calculate_fees','bbloomer_add_cart_fee' );
   
  function bbloomer_add_cart_fee() {
  $noncontinental = array('SBH','SWK','LBN');
  if( in_array( WC()->customer->shipping_state,$noncontinental ) ) {
   $surcharge = 15.00;
   WC()->cart->add_fee( __('Additional Charges For (Sabah,Sarawak & Labuan)','woocommerce'),$surcharge );
  }
  }

我想隐藏供应商电子邮件布局中的“附加费用(沙巴、砂拉越和纳闽)”行作为附件? https://ibb.co/rFnBKWQ

我尝试编辑模板布局,但我不确定应该编辑哪个挂钩或在哪里。我尝试编辑代码如下。

//remove shipping fee from vendor email
add_filter('wcmp_vendor_get_order_item_totals','new_order_mail_display_shipping_method',10,3);
function new_order_mail_display_shipping_method( $order_item_totals,$order,$vendor ) {
unset($order_item_totals['shipping_subtotal']);
unset($order_item_totals['tax_subtotal']);  
unset($order_item_totals['shipping_state']);        
return $order_item_totals;  
}

我该如何解决这个问题?提前致谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)