How to Integrate Metaobject Translations for Size Tags in Liquid Code?

How to Integrate Metaobject Translations for Size Tags in Liquid Code?

MikJark
Shopify Partner
3 0 0

Hi everyone,

I'm trying to add a translation for product sizes in my Shopify store using the "Translate and Adapt" feature. All translations are stored in metaobjects, but I'm unsure how to pull the translated size into my code.

Here’s my current Liquid code:

 

 

 

 

 

 

 

{% assign size_tag = "" %}
{% for tag in product.tags %}
  {% if tag contains "-" and tag contains "(" %}
    {% assign size_tag = tag %}
  {% endif %}
{% endfor %}

{% if size_tag != "" %}
  <p>{{ size_tag }}</p>
{% endif %}

 

 

 

 

 

 

My question is: How can I modify this code to retrieve and display the translated size from the metaobjects? Any help or examples would be greatly appreciated!

Thanks in advance for your support.

Reply 1 (1)
MikJark
Shopify Partner
3 0 0

Thank you for your help! However, your code isn’t working.

To clarify, the information is stored in the Category metafields of each product. In Translate & Adapt, translations for these metafields are located at:
.../translate-and-adapt/localize/metaobject

Additionally, I did not create them in the Custom Data settings.