Print custom product variation field in order email confirmation Added custom field ('field_secretkey') under Commerce - Product variation (admin/commerce/config/product-variation-types). 

I am able to get this value in Orders view by adding the "Product variation" relationship.

I just want to print this value in order confirmation email (commerce-order-receipt.html.twig) It can have multiple items with different values. 

Please advice.

Example:



No | Product Name | Custom field



1 | Product 01 | XYUSNMAI

2 | Product 02 | AYUSSAAA

3 | Product 03 | PAUSNPPP







Updated: RESOLVED - TRY BELOW

URL - {{ order_item.getPurchasedEntity.field_custom_field.0.uri }}

TITLE - {{ order_item.getPurchasedEntity.field_custom_field.0.title }}
You should be able to get the product from the order which is available in the template.

I think that this will give you the products:

{% for order_item in order_entity.getItems %}
  {{ order_item }}// The product
  {{ order_item.FIELD_NAME.value }}// The field value
{% endfor %}


Otherwise you must add the product in a preprocess function.