Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi everyone!
I want to create some general metafields in my shop, but I don't know where should I locate them.
I will explain it with one example. In my product page template, there are some parts that are commons for different products or type of products. Nowadays, I have to copy and paste the same text in all the products. If I decide to change this text, I have to change one by one. I want to allocate this text only in one place to avoid future error and problems- And also optimize my work, obviously...
Well as you already know that you have to use metafields for this.
You can find metafields under settings and custom data from backend or admin of your store. For your needs you need to create product metafields and since you want to add text you can use a multi line text field.
Once you create this product metafield you will find this metafield in each product where you can enter values. You do have to go in every product to do this but this way it's a lot simpler.
Now the main thing is to render this value. What you can do is add a text block and dynamically connect it with the metafield. Note: you have to add a text block to connect text.
One other way is to open your customizer and drag a custom liquid block and add this code
{{product.metafields.custom-value}}
In place of custom value add the name of your metafield. So if you named it text aad text in place of custom value.
Please reach out via mail for a convenient conversation and solution in case you need any help.
Thanks
Shadab
Set defaults for some metafield types when creating the metafield definition
Or make market metafields and set those as dynamic sources in tempaltes.
Or use metaobjects entries as references and through those are what are set to some products as metafields.
Contact [email protected] for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024