Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

Tom Davies commented on Product Variant Metafields are not being updated on a PUT

$
0
0

@rpw - I agree this is a huge PITA.  I ended up just using this approach:

1) For each product, select all variants

2) For each variant, select all metafields

3) Update each variant one at a time

The API around metafields is sorely lacking.  You would have to send a delete call for each metafield anyway so you might as well just do an update instead of a delete then update.

One other approach I would probably use if I need to revisit variant metafields - don't use them :)  I am thinking you can store variant metafield data as product metafields instead using a convention for naming the keys such as:

KEYNAME_SKU = value

Then you can just build that string in Liquid template and use top-level product metafields for all variants.  Top-level product metafields do support bulk updating in my tests.


Viewing all articles
Browse latest Browse all 25503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>