How do I add custom line items to the order summary email?
The order confirmation message type uses a variable !order-summary. Is it possible to edit this? At the moment a customer can enter custom data but there is no indication of this on the order confirmation email.
Comments
Thanks for your reply, tjohnston. The view picked up seems to be commerce_cart_summary. By editing this view I can control what is displayed in the order confirmation email. I can add custom line item fields by adding them to the view and by adding a relationship to the products I can display product attributes such as size, colour etc.
Do you know how the code !order-summary is linked to the particular view? Just wondering if you could clone the view to another name and then get that picked up instead of the default.
Not entirely sure, but what you can do if you want a fully custom display is to create a new view that does exactly what you want then install the Token Embed Views module, https://drupal.org/project/token_embed_views, which allows you to embed views using a token anywhere. So you could use your own custom display on the confirmation page and in the order email.
Brilliant! I'll give that a go as I have quite a complicated layout which is difficult to style nicely with the table view so I'll have one view for the web and one for the email.