0

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

2
  • Can you please show me pdf please Commented Jan 12, 2018 at 6:55
  • updated my question with screenshot, see above
    – Akash
    Commented Jan 12, 2018 at 7:17

1 Answer 1

2

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?>
2
  • yes, I did the same before, and it works for me. Thanks anyway :)
    – Akash
    Commented Jan 12, 2018 at 9:12
  • The correct file path for me is Magento_Sales/templates/email/totals.phtml. Better to add if ($_code=="tax"){ continue;} right after foreach so you do not add extra tr in. Commented Jan 10, 2019 at 4:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.