我想從 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 回答

墨色風(fēng)雨
TA貢獻(xiàn)1853條經(jīng)驗 獲得超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 關(guān)注
- 121 瀏覽
添加回答
舉報
0/150
提交
取消