Wgenie
Wgenie

Reputation: 199

Order totals block on Magento order email and invoice email templates

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

Upvotes: 3

Views: 21686

Answers (4)

rybo111
rybo111

Reputation: 12588

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.

Upvotes: 1

Jason Gilmore
Jason Gilmore

Reputation: 4068

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. :-)

Upvotes: 16

Niels
Niels

Reputation: 61

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

Upvotes: 5

Gabriel Spiteri
Gabriel Spiteri

Reputation: 4978

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

Upvotes: 0

Related Questions