Adding value to a custom metafield using the theme editor

Hi all!

I was wondering if there is a way to add a value to a custom metafield using shopify liquid files?

For example if i set the value manually of said metafield to = ‘1337’ and i want the script to alter the value and set the metafield as ‘This is the altered value’. How would i go about doing that? :slightly_smiling_face:

Best regards

Hi @magnusarni

please use this code and replace with your metafield data

{{ product.metafields.“Your metafield namespace”[“Your metafield key”] }}

Hello @Kani and thank you for your answer.

This references the value set in the metafield and displays it.

Is there a way to change the metafield value in my liquid file?

For example

{{ product.metafields.“Your metafield namespace”[“Your metafield key”] = “MyNewValue”}}

Best regards

nope,

But you can try Postman, it’s easy to change value

1 Like

Alright,

thank you for your time :slightly_smiling_face:

1 Like