For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
This is a JavaScript (not React) extension:
export default extension(
"purchase.checkout.shipping-option-list.render-after",
async (root, {lines, applyCartLinesChange, query, i18n, shippingAddress, shop, buyerJourney, buyerIdentity, storage, settings, ui, metafields}) => {
console.log(metafields.current); // the array is empty
.
.
.
});
my .toml file includes the following:
[[extensions.metafields]]
namespace = "kickee"
key = "notforwholesale"
[[extensions.metafields]]
namespace = "kickee"
key = "nfs"
I only have one target in my .toml so that's not the issue.
I have a product with both those metafields and the metafields are defined:
What am I doing wrong?
thank you,
Chris
This also does not work:
metafields.subscribe((newMetafields) => {
currentMetafields = newMetafields;
console.log(`metafields: `, currentMetafields, newMetafields); // blank arrays
});