我想从 woocommerce 新订单邮件中删除总计和小计。此代码适用于总计,但仍显示小计。add_filter( 'woocommerce_get_order_item_totals', 'reordering_order_item_totals', 10, 3 );function reordering_order_item_totals( $total_rows, $order, $tax_display ){ $shipping = $total_rows['line_subtotal']; $order_total = $total_rows['order_total']; unset($total_rows['line_subtotal']); unset($total_rows['order_total']); return $total_rows;}我试过了['line_subtotal'],你知道它的名字吗['order_subtotal']?['subtotal']十分感谢
1 回答
墨色风雨
TA贡献1853条经验 获得超6个赞
请在functions.php文件中尝试以下代码
add_filter( 'woocommerce_get_order_item_totals', 'reordering_order_item_totals', 10, 3 );
function reordering_order_item_totals( $total_rows, $order, $tax_display ){
$shipping = $total_rows['cart_subtotal'];
$order_total = $total_rows['order_total'];
unset($total_rows['cart_subtotal']);
unset($total_rows['order_total']);
return $total_rows;
}
- 1 回答
- 0 关注
- 105 浏览
添加回答
举报
0/150
提交
取消