I’m building a checkout UI extension and am able to update the order metafield using a string (“Yes” or “No”) with the following code:
const checkValue = value ? "Yes" : "No";
applyMetafieldsChange({ type: "updateMetafield", namespace: metafieldNamespace, key: metafieldKey, valueType: "string", value: checkValue, });
However, trying to update a different, boolean, metafield with the following settings does not work:
applyMetafieldsChange({
type: "updateMetafield",
namespace: metafieldNamespace,
key: metafieldKey,
valueType: "boolean",
value,
});
The metafields and toml are correctly set up with both metafield’s namespace / key. The value on the latter code comes from the props of the onChange attribute, whereas on the former code uses this value with a ternary operator to convert to strings.
Why does the second one not update the metafield? Am I missing something?
Thanks!