I have a Session array like this:
[
{
"itemId": "1",
"itemQuantity": "3",
"itemName": "Item_name1"
},
{
"itemId": "2",
"itemQuantity": "2",
"itemName": "Item_name2"
}
]
How can I update the quantity of a single item if I know the itemId?
I know that one way of doing this would be to fetch the whole array, loop through the array, make the updates and 'put' the entire array back into the session. Is this the only way?
I'm a beginner. Please help out. Thanks.
itemIdauto-incrementing? If it is, how did you achieve it?