Magento invoice email customization
-
16-10-2019 - |
Question
I am trying to setup a Invoice email template in Magento, and I see that the most of the informations I want is displayed.
However, I would like to display the shopping cart content with only the item's name and summary of the cart. I have some kind of product description added in the cart with every product, I don't want that part to be displayed in the email template.
I see that the cart is displayed in email template with:
{{layout area="frontend" handle="sales_email_order_invoice_items" invoice=$invoice order=$order}}
Is there a way to display only items, and without the description for every product?
Solution
You are heading in the right direction. Since you found the handle, a little search and you can find that the sales_email_order_invoice_items
handle is in the sales.xml
file.
<sales_email_order_invoice_items>
<block type="sales/order_email_invoice_items" name="items" template="email/order/invoice/items.phtml">
<action method="addItemRender"><type>default</type><block>sales/order_email_items_default</block><template>email/order/items/invoice/default.phtml</template></action>
<action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>email/order/items/invoice/default.phtml</template></action>
<block type="sales/order_invoice_totals" name="invoice_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"/>
</block>
</block>
<block type="core/text_list" name="additional.product.info" />
</sales_email_order_invoice_items>
- The
email/order/invoice/items.phtml
file is responsible for main template of the invoice. - The
email/order/items/invoice/default.phtml
is most probably what you are looking for, it will be used for each product to display its info.
Thus just copy the email/order/items/invoice/default.phtml
into your own template folder and change whatever you need changed in that file.