A space to discuss online store customization, theme development, and Liquid templating.
Hello,
i have problem, when i want to create new metafield with type `json`
{
"metafield":{
"key": "house-doctor",
"namespace":"vendors",
"value":"{\"nationality\":null,\"sustainability\":true}",
"type":"json"
}
}
{
"metafield":{
"key": "house-doctor",
"namespace":"vendors",
"value":"{\"nationality\":null,\"sustainability\":true}",
"value_type":"json_string"
}
}
Solved! Go to the solution
This is an accepted solution.
Sorry for that. Solution by Robert_Kanaan
-------
Here's a couple of ways to access the values:
{% assign doctor = product.metafields.vendor.house-doctor.value %} <ul> {% for key_value in doctor %} <li> {{ key_value[0] }}: {{ key_value[1] }} </li> {% endfor %} </ul>
Or access the key value directly:
{{ doctor['sustainability'] }}
This is an accepted solution.
solved
what was the solution????
This is an accepted solution.
Sorry for that. Solution by Robert_Kanaan
-------
Here's a couple of ways to access the values:
{% assign doctor = product.metafields.vendor.house-doctor.value %} <ul> {% for key_value in doctor %} <li> {{ key_value[0] }}: {{ key_value[1] }} </li> {% endfor %} </ul>
Or access the key value directly:
{{ doctor['sustainability'] }}