Hi everyone,
I need to get the external inputs in discount functions. I can get the discount metafield in discount functions for that particular discount. Even though I need some dynamic data, It’s like some conditions to validate cart lines to apply discount. How can I get some other metafield data in discount functions? Is there any way to get some other data in the function?
query RunInput($selectedCollectionIds: [ID!]) {
cart {
lines {
quantity
merchandise {
__typename
... on ProductVariant {
id
product {
id
inAnyCollection(ids: $selectedCollectionIds)
}
}
}
}
}
discountNode {
metafield(
key: "test-function-config"
namespace: "test-discount"
) {
value
}
}
}
It’s how I can get the discount metafield. How can I access some other metafield?