![](/img/trans.png)
[英]Rearrange order detail totals on WooCommerce email notifications
[英]Customizing totals lines in Woocommerce customer email notifications
我的 woocommerce 发出了它应该的。
税收字段如何显示似乎是未关闭的标签。
我已经浏览了整个 woocommerce 代码,但找不到标签的生成位置。
这就是我的税务字段在电子邮件中的外观。
Total: DKK 0.00 <small class="includes_tax"
这只能是您对订单总数进行自定义的结果,或者是您的主题或插件正在制作的结果。 默认情况下,Woocommerce 中没有这种行为。 在您的情况下,这似乎是由于插件(或某些自定义)将货币符号显示为 Code 。
现在 Woocommerce 电子邮件通知中的订单总计行是使用WC_Order
方法get_order_item_totals()
然后您可以使用以下代码对其进行更改:
add_filter( 'woocommerce_get_order_item_totals', 'customize_order_line_totals', 1000, 3 );
function customize_order_line_totals( $total_rows, $order, $tax_display ){
// Only on emails notifications
if( ! is_wc_endpoint_url() || ! is_admin() ) {
// Remove any other html tags from gran total value
$total_rows['order_total']['value'] = strip_tags( wc_price( $order->get_total() ) );
}
return $total_rows;
}
代码位于活动子主题(或活动主题)的 function.php 文件中。 它应该可以解决您的问题。
但最好的方法应该是找出有罪的,而不是修补某个地方的某些自定义所做的错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.