This is how you can find out, where the text comes from:
First: use grep
to search for the layout handle sales_email_order_items
in the magento codebase.
You will find some files like app/design/frontend/base/default/layout/sales.xml
where the template is defined:
<!--
Email layouts section
-->
<sales_email_order_items>
<block type="sales/order_email_items" name="items" template="email/order/items.phtml">
<action method="addItemRender"><type>default</type><block>sales/order_email_items_order_default</block><template>email/order/items/order/default.phtml</template></action>
<action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>email/order/items/order/default.phtml</template></action>
<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>
</block>
<block type="core/text_list" name="additional.product.info" />
</sales_email_order_items>
Have a look at the block in the middle <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">...</block>
. If you open sales/order/totals.phtml
you will see that this template contains the loop for the output of the totals. The totals itself come from Mage_Sales_Block_Order_Totals
(check out the @see Mage_Sales_Block_Order_Totals
block in the phtml-file.
The label itself is set in Mage_Sales_Block_Order_Totals
.
Draw your attention to the _initTotals method
:
/**
* Initialize order totals array
*
* @return Mage_Sales_Block_Order_Totals
*/
protected function _initTotals()
{
$source = $this->getSource();
$this->_totals = array();
$this->_totals['subtotal'] = new Varien_Object(array(
'code' => 'subtotal',
'value' => $source->getSubtotal(),
'label' => $this->__('Subtotal')
));
...
}
This means:
The label is set in the _initTotals
method of Mage_Sales_Block_Order_Totals
.
$this->_totals['subtotal'] = new Varien_Object(array(
'code' => 'subtotal',
'value' => $source->getSubtotal(),
'label' => $this->__('Subtotal')
));
The label is put into the template in sales/order/totals.phtml
here:
<td <?php echo $this->getLabelProperties()?>>
<?php if ($_total->getStrong()):?>
<strong><?php echo $this->escapeHtml($_total->getLabel());?></strong>
<?php else:?>
<?php echo $this->escapeHtml($_total->getLabel());?>
<?php endif?>
</td>
How to change the label?
If you want to change the labels in your shop globally I suggest you put it into your translation files (app/design/frontend/yourpackage/yourtheme/locale/en_US/translate.csv in your shop template OR in one of your shop base modules - if you have something like this).
If you only want to change the label in the e-mails, the easiest might be to define your own template for <block type="sales/order_invoice_totals" .... > ... </block>
, for example:
<block type="sales/order_invoice_totals" name="invoice_totals" template="your/costom/template_for_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>
Why creating your own template file?
The template sales/order/totals.phtml
is used quite often in different layout XML-files and you this will also change the label, wherever this template is used.
The issue came down to a conflict. The {{layout handle="sales_email_order_items" order=$order}}
wasn't working because the block it was trying to load - sales/order_email_items
was being extended by a module that had been disabled.
I tested the sales_email_order_items
handle by removing what was in it by default and adding a call to a file just containing static text, which worked. From here I realised that there must be a bug in the blocks it was trying to load and found that I needed to delete the configuration file completely rather than just disable the module of the offending module to stop the conflict.
Best Answer
Temp solution is:
set in db table: email_template column is_legacy = 1 for this new order email template.