I’m developing a website and I’m having issues trying to modify the order.
Deleting modifiers it’s fine just adding the UID to the fieldsToClear.
but adding modifiers to a existing items doesn’t seems to be working, for instance, lets take this object from lineItems
It has an Item with 2 modifiers, but the customer wants to add another modifier to that order.
Test Item
- Add-on Modifier 1
- Add on Modifier 2
{
"uid": "2WMc7OpHLgAG7C39XpNLHC",
"name": "Test Item",
"quantity": "1",
"catalogObjectId": "L2O3GMJS6D2S6HP4YB7XGHK4",
"catalogVersion": "1680288876214",
"variationName": "Regular",
"itemType": "ITEM",
"modifiers": [
{
"uid": "N2apMYYxKbt3QPQPyiAbND",
"catalogObjectId": "2UZIFRUSLLRVCXHQLK2E3OI7",
"catalogVersion": "1680288876214",
"name": "Add-on Modifier 1",
"quantity": "1",
"basePriceMoney": {
"amount": "30",
"currency": "USD"
},
"totalPriceMoney": {
"amount": "30",
"currency": "USD"
}
},
{
"uid": "ltuaRp46ykMYYgTY9utOq",
"catalogObjectId": "N6GTLMDHERB6YVAKY2VN7SDW",
"catalogVersion": "1680288876214",
"name": "Add-on Modifier 2",
"quantity": "1",
"basePriceMoney": {
"amount": "40",
"currency": "USD"
},
"totalPriceMoney": {
"amount": "40",
"currency": "USD"
}
}
],
"appliedTaxes": [
{
"uid": "dc3a4593-2dea-4568-b62d-e7e3e779a3c1",
"taxUid": "2a719a92-c99b-4264-848d-ef7a6790d58d",
"appliedMoney": {
"amount": "23",
"currency": "USD"
}
}
],
"basePriceMoney": {
"amount": "274",
"currency": "USD"
},
"variationTotalPriceMoney": {
"amount": "274",
"currency": "USD"
},
"grossSalesMoney": {
"amount": "384",
"currency": "USD"
},
"totalTaxMoney": {
"amount": "23",
"currency": "USD"
},
"totalDiscountMoney": {
"amount": "0",
"currency": "USD"
},
"totalMoney": {
"amount": "407",
"currency": "USD"
},
"totalServiceChargeMoney": {
"amount": "0",
"currency": "USD"
}
}
What I’m trying to do is just adding the new modifier to the modifiers array like this:
Test Item
- Add-on Modifier 1
- Add on Modifier 2
- Add on Modifier 3
{
"uid": "2WMc7OpHLgAG7C39XpNLHC",
"name": "Test Item",
"quantity": "1",
"catalogObjectId": "L2O3GMJS6D2S6HP4YB7XGHK4",
"catalogVersion": "1680288876214",
"variationName": "Regular",
"itemType": "ITEM",
"modifiers": [
{
"uid": "N2apMYYxKbt3QPQPyiAbND",
"catalogObjectId": "2UZIFRUSLLRVCXHQLK2E3OI7",
"catalogVersion": "1680288876214",
"name": "Add-on Modifier 1",
"quantity": "1",
"basePriceMoney": {
"amount": "30",
"currency": "USD"
},
"totalPriceMoney": {
"amount": "30",
"currency": "USD"
}
},
{
"uid": "ltuaRp46ykMYYgTY9utOq",
"catalogObjectId": "N6GTLMDHERB6YVAKY2VN7SDW",
"catalogVersion": "1680288876214",
"name": "Add-on Modifier 2",
"quantity": "1",
"basePriceMoney": {
"amount": "40",
"currency": "USD"
},
"totalPriceMoney": {
"amount": "40",
"currency": "USD"
}
},
{
"catalogObjectId": "Z33Y2Y3KMTNFPHV2H57PJFVZ",
"name": "Add-on Modifier 3",
"quantity": "1"
}
],
"appliedTaxes": [
{
"uid": "dc3a4593-2dea-4568-b62d-e7e3e779a3c1",
"taxUid": "2a719a92-c99b-4264-848d-ef7a6790d58d",
"appliedMoney": {
"amount": "23",
"currency": "USD"
}
}
],
"basePriceMoney": {
"amount": "274",
"currency": "USD"
},
"variationTotalPriceMoney": {
"amount": "274",
"currency": "USD"
},
"grossSalesMoney": {
"amount": "384",
"currency": "USD"
},
"totalTaxMoney": {
"amount": "23",
"currency": "USD"
},
"totalDiscountMoney": {
"amount": "0",
"currency": "USD"
},
"totalMoney": {
"amount": "407",
"currency": "USD"
},
"totalServiceChargeMoney": {
"amount": "0",
"currency": "USD"
}
}
But it’s not working, any ideas?