I want to output product metafields to Order Printer's Invoice

I have created a multilingual website on Shopify in Japanese and English.
I use T Lab - AI Language Translate( https://apps.shopify.com/content-translation?locale=ja ) for language translation.
I use Order Printer( https://apps.shopify.com/order-printer?locale=ja ) to print Invoice.

*What I want to do
I want to output product metafields to Order Printer’s Invoice.

*Details
I am a Japanese engineer.
I have created a multilingual website on Shopify in Japanese and English.

I would like to put the English translated product name on the Order Printer Invoice. However, I know that this is not possible with T Lab - AI Language Translate.

As an alternative idea, I am thinking of entering the English translated product name in the meta field and putting it on the Order Printer Invoice.

I saw the following community post

https://community.shopify.com/c/shopify-apps/order-printer-metafield/td-p/317957

https://community.shopify.com/c/shopify-%E3%82%A2%E3%83%97%E3%83%AA/order-printer-%E3%81%AE%E6%98%8E%E7%B4%B0%E5%86%85%E3%81%AB%E3%83%A1%E3%82%BF%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%83%89%E8%A1%A8%E7%A4%BA/td-p/1538622

I took a look at these community posts and tried to write the program code.
However, the meta fields were not output.


Example 1 → Nothing is output.

{% for line_item in line_items %}
{{ line_item.product.metafields.custom.en_product_name.value }}
{% endfor %}

Example 2 → Nothing is output.

{% for line_item in line_items %}
{{ line_item.product.metafields.custom.en_product_name }}
{% endfor %}

Example 3 → Nothing is output.

{{ product.metafields.custom.en_product_name }}

Example 4 → Nothing is output.

{{ product.metafields.custom.en_product_name.value }}

Please can you help me with a solution?

Hi,

The following code solved my problem.

{% for line_item in line_items %}
{{ line_item.product.metafields.key.value }}
{% endfor %}

The following post is helpful.

https://community.shopify.com/c/shopify-%E3%82%A2%E3%83%97%E3%83%AA/%E3%82%A2%E3%83%97%E3%83%AA-order-printer-%E3%81%AB%E3%83%A1%E3%82%BF%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%83%89%E3%81%AE%E5%80%A4%E3%82%92%E8%A1%A8%E7%A4%BA%E3%81%95%E3%81%9B%E3%81%9F%E3%81%84/td-p/1645132

This works for me.

My example

meta field to apply to item line in Order Printer

{{ product.metafields.mm-google-shopping.custom_label_4.value }}

written in template as

{{ line_item.product.metafields.custom_label_4.value }}

As explained above the Namespace (mm-google-shopping) is not read in Order Printer so remove and leave the key (custom_label_4) and value (value).