Magento – To remove “Grand Total (Excl.Tax)” from Invoice email Magento 2

email-templatesinvoicemagento2order-emailsales

I want to remove this line from my invoice email.
"Grand Total (Excl.Tax)"

enter image description here

can anyone please tell me the file name or the process to remove this line from invoice email.

thank you

Best Answer

Copy this file from vendor/magento/module-sales/view/frontend/templates/order/totals.phtml and add in your theme: /app/design/frontend/Nameplace/Themename/Magento_Sales/templates/order/totals.phtml

<?php foreach ($block->getTotals() as $_code => $_total): ?>
    <?php if ($_total->getBlockName()): ?>
        <?php echo $block->getChildHtml($_total->getBlockName(), false); ?>
    <?php else:?>
    <tr class="<?php /* @escapeNotVerified */ echo $_code?>">
        <th <?php /* @escapeNotVerified */ echo $block->getLabelProperties()?> scope="row">
            <?php if ($_total->getStrong()):?>  
        <?php
        if ($_total->getLabel() == "Grand Total (Excl.Tax)") {
            continue;
        }
        ?>
            <strong><?php echo $block->escapeHtml($_total->getLabel());?></strong>
            <?php else:?>
            <?php echo $block->escapeHtml($_total->getLabel());?>
            <?php endif?>
        </th>
        <td <?php /* @escapeNotVerified */ echo $block->getValueProperties()?> data-th="<?php echo $block->escapeHtml($_total->getLabel());?>">
            <?php if ($_total->getStrong()):?>
            <strong><?php /* @escapeNotVerified */ echo $block->formatValue($_total) ?></strong>
            <?php else:?>
            <?php /* @escapeNotVerified */ echo $block->formatValue($_total) ?>
            <?php endif?>
        </td>
    </tr>
    <?php endif?>
<?php endforeach?>
Related Topic