Shopify / ui-extensions

MIT License
265 stars 37 forks source link

POS UI Extensions - access to metafields and metaobjects #2193

Open adamwooding opened 2 months ago

adamwooding commented 2 months ago

Please list the related package(s)

ui-extensions, ui-extensions-react

Is your feature request related to a problem? Please describe.

POS UI Extensions currently have issues with persistent storage and caching of data. Currently, we are required to query our server each time the extension is opened, causing slow loading times and a poor user experience for the merchant.

If we were able access values and data as metafields, aswell as in metaobjects, this would greatly improve loading times, also assist in cases where the POS device is offline, and create a faster, better user experience for the merchant.

Already some metafield values are being synced to Shopify POS, such as some product metafields. But these are not accessible via POS UI Extensions.

A bonus would be also being able to access app-data metafields in POS UI Extensions. This would greatly assist with persistent storage issues we currently face.

Access to metafields and metaobjects is desperately needed in POS UI Extensions, for all Shopify objects but most notably products, collections and customers.

Describe the changes you are looking for

Describe alternatives you’ve considered

Currently, to use metafields and metaobjects we need to fetch to our app, then make a call to read the metafield, then pass it to our POS Extension.

arnaudbagnis commented 1 month ago

+1 with same process that checkout ui

# the below configs come from "shopify.extension.toml"

# this not work
[[extensions.metafields]]
namespace = "$app:product-discount"
key = "config"

# this work, you can remove 'xxxx' and 'yyyy' to your variables
[[extensions.metafields]]
namespace = "xxxx"
key = "yyyy"

https://shopify.dev/docs/api/checkout-ui-extensions/2023-07/react-hooks/metafields/usemetafields