Access shop metafields #299
Closed
meandillar
started this conversation in
Feedback: General Improvements
Replies: 2 comments 3 replies
-
We have plans to add shop metafields to Function APIs, but meanwhile your best option is to duplicate the metafield value across the shop and the customization. I had to do something similar here when implementing a Checkout UI extension and discount which needed to share configuration. |
Beta Was this translation helpful? Give feedback.
1 reply
-
This shipped in https://shopify.dev/changelog/new-fields-available-for-shopify-functions-input-queries |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We need a way to access metafields in the function Input other than those that are owned by the Delivery Customization - for example shop metafields. Is this possible?
Background
We have a Plus store and currently use a combination of JS in checkout.liquid and Shopify Scripts to achieve our shipping customisations. There are a few main things we do:
It seems like we'll need to use a combination of a Delivery Customization, a Checkout UI Extension and a Shipping discount function to achieve these things.
Our Problem
The problem we're having is sharing our preset "shipping cutoff times" between the Delivery Customization and the Checkout UI Extension. Currently they are stored in metafields on the shop. We could theoretically access these via the storefront API in the Checkout UI Extension but not in the Delivery Customization. If we set the metafields on the Delivery Customization they are not accessible in the Checkout UI Extension because the Delivery Customization objects aren't available via Storefront API.
Any suggestions would be greatly appreciated :-)
Beta Was this translation helpful? Give feedback.
All reactions