Product type metafield

How can I get title from metafield {{product.metafields.custom.service_add_on }}?

I am getting something like gid://shopify/Product/7489330151526 But when I try {{product.metafields.custom.service_add_on.value }} or {{product.metafields.custom.service_add_on.title }}

it is empty.

Hi @DaniilM ,

Use this Liquid code to get the product title from the metafield reference:

{% assign service_add_on_id = product.metafields.custom.service_add_on | last | plus: 0 %}
{{ all_products[service_add_on_id].title }}

Doesn’t work.