Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

How can I retrieve product variant metafields on checkout UI extension?

remy727
Shopify Partner
40 2 21
Hi everyone!
Is it possible to retrieve product variant metafields on the checkout UI extension?
Neither useAppMetafields nor useMetafields react hooks don't work.
The solution I found:
  • Get variant IDs with StandardAPI.
  • Then use storefront API for each variant to retrieve metafields.

But if there are 10 line items, this requires 10 storefront API calls.

Is there any better way?

Looking for a Shopify App developer? Please visit: https://github.com/remy727
Reply 1 (1)

charles_loder
Shopify Partner
25 1 5

Any update on this? I got the same question