Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hello, I am trying to display Expiry date for different variant of product.
There was no problem when I made single product custom metafield,
But for variant metafield, It seems more complicated than product-metafield.
I guess it need some json code or other coding.
{% for variant in product.variants limit:1 %}
<p>variant.metafields.custom.exdate: {{ variant.metafields.custom.exdate }}<p>
{% endfor %}
I could able to use variant metafield by using that code, but I want it to be displayed when I click different variant and another variant as well. How can I do it?
Please help me..
HI @JJJAAA,
Yes it will be a little complicated. You need javascript to do so. Unfornately, liquid code cannot listen to the clicks. The javascript code will need to be customized to your theme
Hi @JJJAAA ,
You may want to refer to this solved thread for a possible solution.