-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Hi,
I am looking for a solution where i can update the cart with p.e. product.id and product.sizeId
But the code below is not working.
var winkelwagen = cartLS.list();
var id = 2;
var size = 4;
var new_qty = 100;
for (var i = 0; i < winkelwagen.length; i++) {
if (winkelwagen[i].id === id && winkelwagen[i].sizeId === size) {
winkelwagen[i].quantity = new_qty;
break;
}
}
// Update the cart
cartLS.update(winkelwagen);
The problem is that i have p.e. 2 products with the same ID but with different sizeId. So both were updated what is not correct of course.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels