After adding notes to the Shopify POS cart I am using the below function to get the payload of the cart.
var unsubscriber = cart.subscribe(Cart.Action.UPDATE, function (payload) {
console.log('[Client] fetchCart', payload);
unsubscriber();
});
cart.dispatch(Cart.Action.FETCH);
But in the noteAttributes it returns an empty array. Does anyone know the reason why or is there any workaround for this? Below I am attaching my cart payload:
{
"data": {
"grandTotal": "113.0",
"subtotal": "100.0",
"taxTotal": "13.0",
"lineItems": [
{
"quantity": 1,
"price": 100,
"title": "SP Product",
"productId": 8314901430530,
"variantId": 44196134060290,
"custom": false,
"taxable": true,
"variantTitle": "one",
"taxLines": [
{
"price": "13.0",
"rate": "0.13",
"title": "HST"
}
],
"fulfillmentService": "DEFAULT",
"sku": "sp-product",
"vendor": "invoice-mahim3"
}
],
"noteAttributes": []
},
"id": "bee486a1-dfde-0d0a-9ea6-d2f88238a95b"
}