@@ -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