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

  • Can you please show me pdf please – Prashant Barot Jan 12 '18 at 6:55
  • updated my question with screenshot, see above – John Jan 12 '18 at 7:17
1

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?>
  • yes, I did the same before, and it works for me. Thanks anyway :) – John Jan 12 '18 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. – user1506075 Jan 10 at 4:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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