How to access product variant metafields from a checkout extension?

Hi everyone,

We have a checkout extension that needs to find the product variant metafields of all items in the basket.

I cannot see a particularly efficient way to achieve this that doesn’t involve making X requests (X = number of items in basket) to the product query on the storefront API (once we have the product variant id from the useCartLines() hook).

From what I can see, there are no hooks available to checkout extensions that will surface cart line items product variant metafields.

Am I doing something wrong, or is my solution above the only way?

Thanks,
Alex

You can access variant metafields → Configuration

1 Like

Thanks Luke - I looked at this, but it’s too restrictive to have to hard set the variant metafield key, as our merchants set the key, not us (and they are all wildly different and cater to different use cases).