3

I'm trying to style Magento's transactional emails. I already managed it to edit and style the item display and included the item picture, but i haven't found a solution to only display the grandTotal price including tax and style it.

how to only display Grand Total and style it?

Customizing items was quite easy by creating an own /email/items/order/default.phtml. but I couldn't find a file, which generates the price display.

My Magento skills are quite basic. I would be glad for any advice as detailed as possible.

2
  • Did you find this? The solution below also updates areas in checkout and my history page - is there no phtml block only? Commented Dec 17, 2017 at 9:25
  • @TheBlackBenzKid Not really. I think you have to build you own totals block and include it as custom variable in the email template.
    – Leander
    Commented Dec 18, 2017 at 21:21

1 Answer 1

0

I haven't tested it but I think this might work:

Copy over Magento_Sales/view/frontend/templates/order/totals.phtml with the one line added like below:

<?php foreach ($block->getTotals() as $_code => $_total): ?>
    <?php if ($_code !== 'grand_total') continue; // add this line ?>

You should be able to add styling in this file as well.

4
  • Thank you Aaron! We're almost there... Actually only the price excluding tax gets displayed. I need the price incl. tax .
    – Leander
    Commented Jul 21, 2016 at 10:30
  • So what field is it showing? If it's "Grand Total", that amount does have the sales tax included. Commented Jul 22, 2016 at 8:38
  • Sry for my late response. Unfortunately it's showing the total price excluding tax, not including tax.
    – Leander
    Commented Jul 30, 2016 at 22:01
  • This edits the code on every page where their is totals Commented Dec 17, 2017 at 9:24

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.