The layout definition for the new order emails can be found at design/frontend/default/base/layout/sales.xml
with the handle <sales_email_order_items>
.
LAYOUT: app/design/frontend/base/default/layout/sales.xml
<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="core/template" name="order_totals_wrapper" as="order_totals" template="email/order/totals/wrapper.phtml">
<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>
<block type="core/text_list" name="additional.product.info" />
</sales_email_order_items>
The first block declared is Mage_Sales_Block_Order_Email_Items
(sales/order_email_items
) and has the template email/order/items.phtml
. This template controls the loop for rendering each of the order items.
TEMPLATE: app/design/frontend/base/default/template/email/order/items.phtml
<?php $i=0; foreach ($_order->getAllItems() as $_item): ?>
<?php if($_item->getParentItem()) continue; else $i++; ?>
<tbody<?php echo $i%2 ? ' bgcolor="#F6F6F6"' : '' ?>>
<?php echo $this->getItemHtml($_item) ?> // Renders individual products
</tbody>
<?php endforeach; ?>
Mage_Sales_Block_Order_Email_Items::getItemHtml($_item)
will get the relevant item renderer depending on the product type. In most cases this will be Mage_Sales_Block_Order_Email_Items_Order_Default
which has the template app/design/frontend/base/default/template/email/order/items/order/default.phtml
.
This is the template you should overwrite in your theme to modify the position of the table cells. In the template you will see that it has a number of conditions which check for price and tax display settings but does the majority of what you require already.
If you're using them, you might need to update the different product type renderer templates too.