We are trying to access cart line “properties” in checkout extension functions. We were told by Shopify Support that properties were the same as line item attributes. However, we cannot access these properties using attributes in the checkout function. As an example, say we had a product called “WPI Chocolate” and it had a property of “discount”, we can’t access it from our function. The example is shown below:
<input type="hidden" name="properties[discount]" value="percent::45" />
We have the input GraphQL as follows:
query Input {
cart {
lines {
quantity
attribute(key: "discount"){
key
value
}
merchandise {
__typename
...on ProductVariant {
id
}
}
}
}
}
However, the attribute always returns null or empty. The question is how can we access the property? Also, how would we access multiple properties/attributes using the same GraphQL query?