cancel
Showing results for 
Search instead for 
Did you mean: 

Editing text in transaction email

Editing text in transaction email

Hi, probably an easy question to answer, but two hours of googling and as much again trying to find a file I can amend and no luck. I simply want to change two words that appear in the invoice emails sent to customers. I want to change the word Tax to VAT, see attached. Surely this should be a two minute job.Screen Shot 2019-06-21 at 15.44.42.png

4 REPLIES 4

Re: Editing text in transaction email

@ken_davies 
You can use translation file to update the text if you want to update globally. 

If in specific place then you look into following file and update there. But make sure you should override this file into your current theme.

vendor\magento\module-tax\view\frontend\templates\checkout\subtotal.phtml

I hope it will help you!

Re: Editing text in transaction email

Hi Vimal

 

I can see that the file you mention is the email as the code is in tables, but can't see anywhere in there to make text amends. This is the code relating to the shipping totals.

 

<tr class="totals shipping incl">
        <th style="<?= /* @escapeNotVerified */ $block->getStyle() ?>" class="mark" colspan="<?= /* @escapeNotVerified */ $block->getColspan() ?>" scope="row">
            <?= /* @escapeNotVerified */ $block->getIncludeTaxLabel() ?>
        </th>
        <td style="<?= /* @escapeNotVerified */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml($block->getIncludeTaxLabel()) ?>">
            <?= /* @escapeNotVerified */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getShippingIncludeTax()) ?>
        </td>
    </tr>
    <?php elseif ($block->displayIncludeTax()) : ?>
    <tr class="totals shipping incl">
        <th style="<?= /* @escapeNotVerified */ $block->getStyle() ?>" class="mark" colspan="<?= /* @escapeNotVerified */ $block->getColspan() ?>" scope="row">
            <?= /* @escapeNotVerified */ $block->getTotal()->getTitle() ?>
        </th>
        <td style="<?= /* @escapeNotVerified */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>">
            <?= /* @escapeNotVerified */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getShippingIncludeTax()) ?>
        </td>
    </tr>

Re: Editing text in transaction email

Sorry I opened the wrong file. I have made changes as below.

 

?>
<?php if ($block->displayBoth()):?>
<tr class="totals sub excl">
<th style="<?= /* @escapeNotVerified */ $block->getStyle() ?>" class="mark" colspan="<?= /* @escapeNotVerified */ $block->getColspan() ?>" scope="row">
<?= /* @escapeNotVerified */ __('Subtotal (Excl. VAT)') ?>
</th>
<td style="<?= /* @escapeNotVerified */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml(__('Subtotal (Excl. VAT)')) ?>">
<?= /* @escapeNotVerified */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getTotal()->getValueExclTax()) ?>
</td>
</tr>
<tr class="totals sub incl">
<th style="<?= /* @escapeNotVerified */ $block->getStyle() ?>" class="mark" colspan="<?= /* @escapeNotVerified */ $block->getColspan() ?>" scope="row">
<?= /* @escapeNotVerified */ __('Subtotal (Incl. VAT)') ?>
</th>
<td style="<?= /* @escapeNotVerified */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml(__('Subtotal (Incl. VAT)')) ?>">
<?= /* @escapeNotVerified */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getTotal()->getValueInclTax()) ?>
</td>
</tr>
<?php else : ?>
<tr class="totals sub">
<th style="<?= /* @escapeNotVerified */ $block->getStyle() ?>" class="mark" colspan="<?= /* @escapeNotVerified */ $block->getColspan() ?>" scope="row">
<?= /* @escapeNotVerified */ $block->getTotal()->getTitle() ?>
</th>
<td style="<?= /* @escapeNotVerified */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>">
<?= /* @escapeNotVerified */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getTotal()->getValue()) ?>
</td>
</tr>
<?php endif;?>

Re: Editing text in transaction email

Hey @ken_davies 

Did it work for you?

If you want to change for admin order details page then you need to edit following file. 

vendor/magento/module-sales/view/adminhtml/templates/order/totals/tax.phtml


For best approach you need to override this file in your current theme. 

I hope it will work for you!