Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Can I get the order's custom metafield in checkout ui-extension?

Can I get the order's custom metafield in checkout ui-extension?

Sky1245
Shopify Partner
2 0 0

Now I have inserted a metafield to order.
It's ship date.
This is inserted when order is created using Flow.
And this ship date has to be displayed on thank-you page.
So I developed a checkout ui-extension.
But I can't get this custom metafield in checkout ui-extension.
How can I get it?

Replies 2 (2)

Liam
Community Manager
3108 344 910

Hi - it doesn't look like order metafields are supported in checkout UI extensions, I believe only the metafields listed here are accessible. 

 

 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

diemonds
Shopify Partner
2 0 1

I have not found documentation that supports this, but I am using it in a Checkout UI extension, and it works (added ts ignore to avoid the error of the type not existing):

 

  const orderMetafields = useAppMetafields({
    // order type exists
    // @TS-ignore
    type: "order",
    namespace: "[NAMESPACE]",
  });