displaying new shopify metaobjects with liquid

Hey guys,

I try to display new shopify metaobjects with liquid code.

I would like to show the content of the field “Informationen zu Allergenen”. Which could be “Sulfite”, “Nuts”, “Egg” and so on..

What variable do I need to use to show it in custom liquid inside the customizer?

Thank you in advance!

best

Julian

Hello @julson11 ,

Can you please share a translated screenshot?

Thanks

Hi @Guleria

thanks for your reply.

Yes gladly, looking forward to hearing from u!

Really want to help but still not sure how you created it and where you are using it.

If you don’t mind, can you provide the store access ?

@Guleria Okay, sorry :grinning_face_with_smiling_eyes:

I’m in “Metaobjects”

Then “Allergen information”

Then I click on the upper right on “Manage definition”
then I see this:

And I would like to show the value of this Metafield on a product page with custom liquid.
But I cannot find the right code/variable for that.

Does that help? :slightly_smiling_face:

Try this

{% assign allegrians = all_metaobjects['shopify--allergen-information'] %}
{% if allegrians.size > 0 %}
  
    {% for allegrian in allegrians %}
      - {{ allegrian.label }}

     - {{ allegrian.taxonomy_reference}}
    {% endfor %}
  
 
{% endif %}

@Guleria
Thanks for your reply.

I added it here:

But it does not work.

Here you can see that the field is filled in the product:

What can we try else?

Try this one

{% if product.metafields.custom.shopify--allergen-information %}
  {% assign allegrian_info = product.metafields.custom.shopify--allergen-information | metaobject %}
  {{ allegrian_info.label }} 
{% endif %}

@Guleria :disappointed_face: unfortunately also no content

Anyone already figured this out? I’m running into the same problem. Have tried everything I could but still no output. I’d love to have it fixed