Hello community,
I am wondering if someone can help me with the situation mentioned below:
I have a store where we will be selling tea’s and the customers will have an option to choose different bag sizes(100 Gm., 500 Gm. and 1Kg.).
So, 100 Gm makes 20 cups, 500 Gm. makes 100 cups and 1 Kg. gives 200 cups.
The issue is upon selecting the size 500 Gm., I want the text “Makes 20 Cups” to change to “Makes 100 Cups”.
I have tried metafields but it didnt work. I am attaching a few screenshots for the reference.
Thank you in advance for the help, I appreciate it alot.
Hi @jampack7 Thanks for providing the video, Usually metafield use to work perfectly in this situation as it can store dynamic data in it and show the same on any page, I am not sure why it is not working in your case may be you are not applying it in right way.
But still keeping aside the metafield’s way there are couple of way that I can suggest through which you can achieve this.
- The first way to achieve this will be from javascript, you need to custom code it through javascript so that it will work when you will click on different variant. You need to write it in a way so that it will work on only those products to which you want to show this.
- The another way will be a workaround, in this way you need to add the text in your SKU Column and then show that column in the frontend, so that it will change when you click on different variants.
If you will need any help to implement the same then I’m happy to do this for you, let me know. I can implement the code changes so that this will work well for you.
Hopefully it will help you. If yes then Please hit Like and Mark it as solution!
Best Regards
Sahil
Hey Sahil, thank you for the solution. I love both your ideas, but I would still like explore the metadata, do you think you can help me with the check what’s wrong with the metadata? Also, would love to know about javascript.
Hi @jampack7 Yes I would love to help you with your metafield, also will happy to tell you how you can use Javascript but you need to just use 1 of this not both of them.
Best Regards
Sahil
Lets do it! Thank you!
how can we do it?
Hi @jampack7 Can we continue our conversation on private message, so that we can figure out how we can achieve this, You can messaged me privately or we can connect over email as well.
Best Regards
Sahil
aman.lalwani@hotmail.com, send me a message here.
Thank you!