Update metafields value by change variant

gurmeetshergill
New Member
3 0 0

Hello Everyone,


I am working on a store, where i am using Metafields Guru App.
I successfully created metafields and values are showing in the product page as shown below screenshot. I used the following code to display values of metafields:

<div class="product_description2">
          <table>
            {% if product.metafields.details.construction != blank %}
            <tr>
              <td> Color:</td>
              <td> {{product.metafields.details.construction}} </td>
            </tr>
            {% endif %}
          </table>
</div>

screen.jpg

 

Now, i want to change the values of metafields when i select a particular variant or switch between variants of this product. [I want this functionality because every variant has different values like SKU, UPC, other product specifications etc..and i want to show all these values according to variant]

How can i do this, please guide me in this matter. 

Thanks 

Reply 1 (1)
gurmeetshergill
New Member
3 0 0

Hello

I have applied code to show metafields values of variants, below screenshot showing code:

capture.jpg

After apply this code, all "key_values" of "individual namespace" of "all variants" showing at same time. 
I want to show one key_value at a time of particular variant.(I have a unique value of all variants i.e. SKU for all variants)

Thanks