自定义Woocommerce客户发票电子邮件通知中的总计行
My woocommerce sends out an as it is suppose to.
How ever the tax fields shows up with what seems to be an unclosed tag.
I have grepped thru the entire woocommerce code, but I cant find where the tags are generated.
this is how my tax field looks in the email.
Total: DKK 0.00 <small class="includes_tax"
我的woocommerce发出了一个假设。 p>
税收字段如何显示似乎是未关闭的标签。 p>
我已经通过整个woocommerce代码进行了搜索,但我无法找到生成标记的位置。 p>
这是我的税务字段在电子邮件中的显示方式。 p>
总计:DKK 0.00&lt; small class =“includes_tax”
code> pre>
div>
This can only be the result of a customization that you have made on order totals, or that your theme or a plugin is making. By default there is no such behavior in Woocommerce. It seems in your case due to a plugin (or some customizations) that displays the currency symbol as a Code.
Now order totals rows in Woocommerce email notifications are generated using the WC_Order
method get_order_item_totals()
Then you can make changes in it using the following code:
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;
}
Code goes in function.php file of your active child theme (or active theme). It should solve your problem.
But the best way should be to find out the guilty, instead of patching something wrong done by some customization somewhere.