Hello,
I’m using metafields product and it return for me API this: gid://shopify/Product/
how I can get product this by liquid?
Hello,
I’m using metafields product and it return for me API this: gid://shopify/Product/
how I can get product this by liquid?
Hi @Typostores ,
You can store the product saved in the metafield in a variable as shown in code added below:
{% assign product_addon = product.metafields.custom.product_addon.value %}
By the above code the product_addon variable will store the entire data of the product in json format as in normal liquid code usually does.
You can access the addon product properties as you usually do normally :
product id: {% assign product_addon_id = product_addon.id %}
product title: {% assign product_addon_title = product_addon.title %}
product default variant: {% assign product_addon_default_variant = product_addon.selected_or_first_available_variant %} and so on
Hope my answer helps you
Thanks