How to remove "shipping subtotal" from Woocommerce’s new order emails?

I can’t seem to find a solution for this. I tried unsetting the code but then it removes totals too. I want to leave totals and remove shipping totals.

<?php
            if ( $totals = $order->get_order_item_totals() ) {
                $i = 0;
                foreach ( $totals as $total ) {
                    $i++;
                    ?><tr>
                        <th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
                        <td style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
                    </tr><?php
                }
            }
        ?>

Read more here: How to remove "shipping subtotal" from Woocommerce’s new order emails?

Leave a Reply

Your email address will not be published. Required fields are marked *