【发布时间】:2018-02-10 19:16:54
【问题描述】:
当客户下订单时,如果已经使用免费送货,我想从订单确认邮件中发送到 remove shipping info 给客户。
有可能实现吗?
【问题讨论】:
标签: php wordpress woocommerce orders email-notifications
当客户下订单时,如果已经使用免费送货,我想从订单确认邮件中发送到 remove shipping info 给客户。
有可能实现吗?
【问题讨论】:
标签: php wordpress woocommerce orders email-notifications
这个自定义挂钩函数可以实现这一点(但来自所有电子邮件通知):
add_filter( 'woocommerce_get_order_item_totals', function( $total_rows, $order, $tax_display ){
// Only for "Free Shipping" method
if( ! $order->has_shipping_method('free_shipping') || is_account_page() || is_wc_endpoint_url( 'order-received' ) )
return $total_rows;
unset($total_rows['shipping']);
return $total_rows;
}, 11, 3 );
代码进入您的活动子主题(或主题)的 function.php 文件或任何插件文件中。
此代码已经过测试并且可以工作。
【讨论】: