diff options
Diffstat (limited to 'src/helpers/cart.js')
| -rw-r--r-- | src/helpers/cart.js | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/helpers/cart.js b/src/helpers/cart.js index 8712c03a..2cd8da7b 100644 --- a/src/helpers/cart.js +++ b/src/helpers/cart.js @@ -14,14 +14,9 @@ const getItemCart = (product_id) => { return cart[product_id]; } -const createOrUpdateItemCart = (product_id, quantity) => { +const createOrUpdateItemCart = (product_id, quantity, to_process = false) => { let cart = getCart(); - let isFoundInCart = cart[product_id]; - if (isFoundInCart) { - cart[product_id].quantity = quantity; - } else { - cart[product_id] = { product_id, quantity }; - } + cart[product_id] = { product_id, quantity, to_process }; setCart(cart); return true; } |
