Metafield access issue with Shopify theme variant

I’m using a custom_cross_selling metafield on product variants.

In Liquid, I use:

{% assign product_list = product.selected_or_first_available_variant.metafields.custom.custom_cross_selling.value %}

{% for p in product_list %}
  {{ p.title }}
{% endfor %}

But the rendering isn’t working as expected.

Can you check what type of object the metafield returns and what correct Liquid syntax I should use?

Hello @Claudia_Mentuccia

Can you tell me what type of data you are entering with the metafield? I am assuming you are using the List Type one. I have added the correct code for this at the end.

**1. List value type.
**

Here you can see that the type is List.

Here you enter multiple items. And this is how it looks.

**Solution:

{% assign product_list = product.selected_or_first_available_variant.metafields.custom.custom_cross_selling.value %}

{% for p in product_list %}

  {{ p }}

{% endfor %}

Dont need the .title at the end.