3

Can anyone point me to the templates/code blocks that are used for the order totals block on the Magento order mail and invoice e-mail templates?

The tax issue is solved but I need to implement some logic to get rid of the shipping and the subtotal. Which templates are used for the emails? I found the frontend and changed this as needed, but can't find the template/block that is used for the e-mails sent by the system.

Can anyone point me in the right direction?

Thanks, Bart

Wgenie
  • 199
  • 1
  • 2
  • 11

4 Answers4

16

Niels answer of app/design/frontend/base/default/template/sales/order/totals.phtml is correct however I thought some further clarification was in order because one doesn't merely make cosmetic changes to this file in order to effect the desired change. totals.phtml loops over the "totals", each of which produces a total-related line-item (Subtotal, Shipping & Handling, Tax, Grand Total (Excl. Tax), and Grand Total (Incl. Tax)). Your best bet is to use Mage::Log to output each of the totals (which are looped over via an associative array $_code => $total). If you log each key ($_code), you'll see names such as subtotal, shipping, grand_total, tax, and grand_total_incl. I filtered out those from the sales order e-mail that I didn't want by adding the following code directly below the foreach:

<?php if (in_array($_code, array('grand_total'))) { 
    continue;
} ?>

Hopefully this will help anybody who is puzzling over where these totals are mysteriously coming from. :-)

Jason Gilmore
  • 3,698
  • 3
  • 23
  • 28
  • genius, I would never have thought of this :) – Jacob Raccuia Aug 30 '13 at 18:04
  • Great! Works in Magento 1.9 – Leonidas Mar 04 '15 at 13:48
  • Kinda late, but for everyone that reads this thread, this is also the file which is used for the sales order view in the frontend of the shop. So every change you'll make, will be shown on the frontend on the "Order page". /sales/order/view/order_id/XXX – d1m5n Mar 05 '15 at 10:13
  • I want to remove the line "Grand Total to be Charged from", how can i do that? – Gem Jun 29 '18 at 07:17
5

This template is being used for the totals in the e-mail templates and order overview in My Account:

app/design/frontend/base/default/template/sales/order/totals.phtml

Niels
  • 61
  • 2
  • 5
  • Kinda late, but for everyone that reads this thread, this is also the file which is used for the sales order view in the frontend of the shop. So every change you'll make, will be shown on the frontend on the "Order page". /sales/order/view/order_id/XXX – d1m5n Mar 05 '15 at 10:14
1

Jason's answer is good for telling Magento to not generate the likes of grand_total HTML. However, you should look at System > Configuration > Sales > Tax to see if you can remove the fields the proper way first.

If you then see a message saying "Warning tax configuration can result in rounding errors" at the top of your admin pages, you'll need to adjust your settings. See the manual for the default settings, if you need them.

rybo111
  • 12,240
  • 4
  • 61
  • 70
0

I am not entirely sure but could it be this one:

\app\design\adminhtml\default\default\template\email\order\items.phtml

Directory might not exactly match yours but I'm sure you would be able to find it.

HTH

Gabriel Spiteri
  • 4,896
  • 12
  • 43
  • 58
  • Thx HTH but it did not help alot. I wish to use the same logic for the totals on the mail as for displaying them in the frontend (cart & order review during checkout). Adjusting the templates did not have the required result. Will dig a little further... When I find it I will post it. In the meantime: Any other suggestions? – Wgenie Jul 05 '11 at 07:04