Skip to content

Commit 56c3d65

Browse files
authored
Merge pull request #336 from w3bdesign/develop
Fix spelling error
2 parents 0d3a586 + 02a7b51 commit 56c3d65

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

utils/functions/functions.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const getUpdatedProducts = (
9999
);
100100

101101
// If product exists ( index of that product was found in the array ), update the product quantity and totalPrice
102-
if (-1 < productExitsIndex) {
102+
if (-1 < productExistsIndex) {
103103
let updatedProducts = existingProductsInCart;
104104
let updatedProduct = updatedProducts[productExistsIndex];
105105

@@ -158,17 +158,17 @@ export const removeItemFromCart = (productId) => {
158158
}
159159

160160
// Check if the product already exits in the cart.
161-
const productExitsIndex = isProductInCart(existingCart.products, productId);
161+
const productExistsIndex = isProductInCart(existingCart.products, productId);
162162

163163
// If product to be removed exits
164-
if (-1 < productExitsIndex) {
165-
const productTobeRemoved = existingCart.products[productExitsIndex];
164+
if (-1 < productExistsIndex) {
165+
const productTobeRemoved = existingCart.products[productExistsIndex];
166166
const qtyToBeRemovedFromTotal = productTobeRemoved.qty;
167167
const priceToBeDeductedFromTotal = productTobeRemoved.totalPrice;
168168

169169
// Remove that product from the array and update the total price and total quantity of the cart
170170
let updatedCart = existingCart;
171-
updatedCart.products.splice(productExitsIndex, 1);
171+
updatedCart.products.splice(productExistsIndex, 1);
172172
updatedCart.totalProductsCount =
173173
updatedCart.totalProductsCount - qtyToBeRemovedFromTotal;
174174
updatedCart.totalProductsPrice =

0 commit comments

Comments
 (0)