4

I am looking to edit the block of the email that contains the order totals (shipping, grand total), but cant find the template file for this bit of code

I need to remove shipping and grand total lines, only showing subtotal lines

I have checked the template via System > Transnational Emails Looked at a large group of phtml files trying to find this specific instance (will be for both registered and unregistered users if this makes a difference)

currently the email is formatted as:

[logo]
hello {name/guest}
thank you message, {email} {tel}
order id info and date
billing info / payment method
shipping info / shipping method

order details - assuming this is {{layout handle="sales_email_order_items" order=$order}}

thank you message

on the order details line its a table

line item for each: item, sku, qty, subtotal

after all of the items is subtotal, then next line is shipping, then next line is total - it is 2 of those lines i want to get rid of, shipping and either subtotal or total

Kender
  • 1,191
  • 3
  • 15
  • 34

2 Answers2

4

In sales.xml layout, there is sales_email_order_items which is responsible for order items and contains

 <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
            <action method="setLabelProperties"><value>colspan="3" align="right" style="padding:3px 9px"</value></action>
            <action method="setValueProperties"><value>align="right" style="padding:3px 9px"</value></action>
            <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml">
                <action method="setIsPlaneMode"><value>1</value></action>
            </block>
        </block>

Try to assign new template instead of sales/order/totals.phtml in order_totals and modify that new template to display only totals. I have not tested but this can give you direction.

Kamal Joshi
  • 1,298
  • 3
  • 25
  • 45
  • looking at: `/app/design/frontend/base/default/template/sales/order/totals.phtml` its strictly a foreach.. can this be moved to my template folder and edited there (without editing the sales.xml for what file it looks at)? – Kender Feb 20 '14 at 18:01
  • Yes, I did move it to my theme folder and edited, worked nicely, added an if statement `if($_total->getLabel() == 'Subtotal') :` to only show that line – Kender Feb 20 '14 at 18:14
  • I think that the template `sales/order/totals.phtml` is used in other places besides the order totals in the order confirmation email. For example it also seems to be used when displaying the order in the customer's account. Just keep this in mind when editing this template. For me it's fine as I need to update the totals everywhere, not just in the order confirmation email. – Louis B. Jun 29 '15 at 11:01
  • Yes, that's correct. That template is used in other places too. – Kamal Joshi Jun 29 '15 at 12:28
3

The default emails are located on

 /app/locale/en_US/template/email/ 

Thanks

lavb
  • 618
  • 7
  • 20
  • I assume then that the part i want is handled by `{{layout handle="sales_email_order_items" order=$order}}` and I need to know where this layout is at – Kender Feb 20 '14 at 14:57
  • I have looked here `\app\design\frontend\base\default\template\email\order\items\order` and could not find a block for `shipping & handling` anywhere to remove from the template – Kender Feb 20 '14 at 15:38