更新时间:
将删除以下代码
(includes NZD $0.65 International Price Adjustment 15%)
税号,税号
面向国际客户
,购物车上,结帐,订单和电子邮件通知:
// For Cart and checkout pages
add_filter( 'woocommerce_cart_totals_order_total_html', 'hide_iternational_tax_label', 20, 1 );
function hide_iternational_tax_label( $value ) {
// For international orders we display only the total, not the taxes line below
if( 'NZ' != WC()->customer->get_billing_country() )
return '<strong>' . WC()->cart->get_total() . '</strong> ';
return $value;
}
// For customer Order received, Order view and email notifications
add_filter( 'woocommerce_get_formatted_order_total', 'hide_iternational_order_tax_label', 20, 4 );
function hide_iternational_order_tax_label( $formatted_total, $order, $tax_display, $display_refunded ) {
// For international orders we display only the total, not the taxes line below
if( 'NZ' != $order->get_billing_country() ){
$tax_string = ''; // <=== nulling the tax string
$order_total = $order->get_total();
$formatted_total = wc_price( $order_total, array( 'currency' => $order->get_currency() ) );
$total_refunded = $order->get_total_refunded();
if ( $total_refunded && $display_refunded ) {
$formatted_total = '<del>' . strip_tags( $formatted_total ) . '</del> <ins>' . wc_price( $order_total - $total_refunded, array( 'currency' => $order->get_currency() ) ) . $tax_string . '</ins>';
} else {
$formatted_total .= $tax_string;
}
}
return $formatted_total;
}
代码进入功能。活动子主题(或活动主题)的php文件。
已测试并正常工作。