Display product variants metafields

Solved

Thanks for the reply, Mike. Bummer! Glad you eventually got it sorted one way or another though.

I eventually got Temitope's script to work for me. Mine was a little more involved because I had a large array of metafields I wanted to display in a specs chart, per variant. In the end, I combined all specs fields from my source application (netsuite) into a single metafield in Shopify. Then it was plug and play with his script.

0 Likes
New Member
1 0 0

Hi Jason,

 

I'm currently having the same issue. I would like to display variant metafields dynamically on the product page under the dimensions tab. I'm currently Kitting bed SKU's with different size variants and would like the product and package dimensions to change dynamically when variant is selected.

I'm using an app Excelify to import metafield data

Link to store: https://www.boisetcuir.com/

Link to product page: https://www.boisetcuir.com/collections/beds/products/avalon-series-king-bed-frame

 

bed 2.JPGbed 1.JPG

Much appreciated!

 

0 Likes
Tourist
3 0 1

Hi there, sorry this came late, I don't usually check the forum's notifications.

The first part of the code will work on any template but the part responsible for updating the info when the variant is changed must be adapted to the template you are using. 

This is the script responsible for changing the info when the variant is changed, this is based on Shopify Prestige template, if you are using a different template, you'll need to adapt it to the template. The script is getting the id of the variant that is changed to and calling the shippingInfo function. You'll most likely need a developer to adapt the code to your template. 

// When the variant is changed, get the id and call the function. :)
  document.addEventListener('variant:changed', function(event) { 
    var variant = event.detail.variant; // Gives you access to the whole variant details
    var id = variant.id 
     shippingInfo(id);
  });

 

Thanks

0 Likes
Tourist
5 0 1

Can anyone recommend a dev that could do this for me?
I can get the meta fields displaying on the initial product page, but would also like it to change with each variant.

https://www.willowbay.co.uk/products/birlea-balmoral-fabric-bed-grey-velvet

 

 

0 Likes
Explorer
70 11 15

I got this to work for the debut theme, if it's any help to you. The details are on this post:

https://community.shopify.com/c/Technical-Q-A/Help-with-Metafield-descriptions-for-variants/m-p/1003...

0 Likes
Tourist
3 0 1

Hi, I can help, 

let's chat here https://www.freelancer.com/u/topenze.html

or add me up on Skype @Topenze 

0 Likes