How to create metafield with a value_type of 'json_string' ?

Hi.

I'm using ShopifyFD mainly and it does not seem to work with value_type of 'json_string'.

I've been through the main thread and read the (very) prompt documentation (links bellow) and it all seem obvious for everyone (but me ^^). 

 

So, to take a previous example, here's what I tried among many other attempts (with ShopifyFD):

 

namespace:

 

pricing

Key:

preferred

Value:

{
  "price_each": 50,
  "price_per_unit": 2500,
  "price_per_case": 10000
}

 

I typed this in my html :

 

{{ product.metafields.pricing.preferred.price_each }}

 

And it returns nothing. I have no issue with other kind of values, but 'json_string' is not working, and if ShopifyFD can't handle it, where can I write this type of metafield in my files ?

 

Thanks hips for your help!

 

---


Links:
https://help.shopify.com/en/themes/liquid/objects/metafield#learn-more 
https://community.shopify.com/c/API-Announcements/New-json-string-value-type-for-Metafield-object/m-...)

C'est simple comme bonjour ! Ou presque.
Need some help to customize your website? Message me anytime: 5euros.com/profil/maxdesign
0 Likes
Jason
Shopify Expert
10039 119 1876

ShopifyFD doesn't support the json type so you're not crazy - just something I never added in. If it's returned to a glorious working start that type will be added. You'll need to look to other tools or directly via the API in the meantime if you need that json type.

 

Otherwise look to add the data in a less sexy string format that Liquid can still parse (with the split filter) like comma separated or pipe separated.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
Atiqur_Rahman
Shopify Partner
14 1 14

NO Json! You are wrong! The JSON format works fine! I just tried his codes and it works!

 

I used this for collections tho.

{{ collection.metafields.general.testing.price_each }}

If you have any requirement, please email me directly to ratiqur807@gmail.com

I'm the GENUINE EXPERT that you might need today!
0 Likes

Hi @MaxDesign 

Can you access the json string of the product metafield? I try to do the same thing for one of the product metafields but it's not working. Can you find the solution finally?

SPO - SEO App to research keywords & edit social link preview
0 Likes