3
Answers
Vote up!
0
Vote down!

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.

Asked by: Lance Holland
on October 29, 2013

3 Answers

Vote up!
-1
Vote down!

Hello Lanceh1963,

There is a view with that name that you can override with what you need.

Travis
Answer by: Travis
Posted: Nov 1, 2013

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.

- Lance Holland on November 2, 2013

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.

- Travis on November 2, 2013

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.

- Lance Holland on November 3, 2013
Vote up!
0
Vote down!

I was wondering if anyone has managed to make this work with Token Embed Views. I have created a view that shows the line items and takes the order-id as argument. I just don't know how I can give the order-id of the confirmation email as argument to the token of that view.

Answer by: Suraj Ho
Posted: Nov 16, 2014

Comments

I just got this working with Token Embed Views.

[views:embed:email_shopping_cart_summary:block_1:@{message:message-commerce-order:order-number}]

message:message-commerce-order:order-number is a token and being passed as an argument to the view, which is a customised cart view.

From the Token Embed Views Module, syntax for your token should be:
[views:embed:view-name:display-id:arg1/arg2/arg3]

- Che on October 16, 2015
Vote up!
-1
Vote down!

Subscibe! Same problem, i´m eating chairs already ....

Answer by: sammyfm
Posted: Oct 31, 2013