How to get value of metaobjects in order status page via liquid template

How to get value of metaobjects in order status page via liquid template

3digiart
Shopify Partner
1 0 0

Hi,

 

we are a store who provides 3D scanning service for our customers and we are using shopify to process the POS checkout and customer management.

 

Our working flow is that the customer finishes the 3D scanning in our local shop, we store the 3D data and upload the link to a custom metaObjects via an shopify app developed by us and running locally in our server. 

 

 

The Costomer Model Data contains a meta object for each individual order(and scanning). Now I would like to extract the info and show the link in the checkout thank-you page, so that the customer can view the 3D model or download it in any time.

 

3digiart_0-1698682582238.png

3digiart_1-1698682650112.png

 

However, I can't retrieve the metaObject from the exposed liquid objects in this page. According to https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status, checkout and shop libquid objects are accessible. When I try

 

 

 

 

{{ checkout.order.metafields.custom_model_data.<handle> | json}}

 


I got a response like 

 

 

[
"gid://shopify/Metaobject/<id>",
"gid://shopify/Metaobject/<id>"
]

 

 

and if I try to use such code 

 

 

 

 

 {{shop.metaobjects.customer_model_data.<handle> | json}

 

 

 

 

I got nothing, it's an empty object.

 

I have checked that the metaObject content is active and it's accessible by the shop. Did I miss something? I have spent on this issue for a long while, thanks a lot in advance for any help.

 

Best regards

Replies 2 (2)

gr_trading
Shopify Partner
1976 146 205

First this is an array I think you should use for loop and try .value to get the metaobject details.

 

 

 

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
Zokor
New Member
4 0 0

I have the same problem, the .value doesn't output anything.

 

<pre>{{ product.metafields.custom.color_and_slug }}</pre>


 this gets me 

 

["gid://shopify/Metaobject/125980836177","gid://shopify/Metaobject/126178918737"]

 

{% for metaobject in product.metafields.custom.color_and_slug %}
{{ metaobject.product_color.value }}
{{ metaobject.product.value }}
{% endfor %}


I've tried with, without value. , with values. without values. if i put any text the loop doesn't happen.