Git Product home page Git Product logo

mern-e-commerce's Introduction

mern-e-commerce's People

Contributors

omkar-asort avatar omkarsk98 avatar shubham1710 avatar stormkid2009 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mern-e-commerce's Issues

some issues in add cart item API route

I would like to report some errors that I have found in your add_cart_item controller. These issues have gone unnoticed and I believe they need to be addressed. Here are the details:

When an item is added to the cart and there are existing items in the cart (if(itemIndex > -1){...}), the price of the new item(s) is not being updated. This could lead to incorrect billing and confusion for the user.

Similarly, when there are existing items in the cart (if(itemIndex > -1){...}), the old total price of the item is not being subtracted from the bill. This could cause issues if the admin changes the price of a product item and the user ends up buying it at the old price.

To resolve these issues, I suggest the following new code:

if (itemIndex > -1) {
let productItem = cart.items[itemIndex];
cart.bill -= productItem.quantity * productItem.price; // Subtract the old total price of the item from the bill
productItem.quantity += quantity;
productItem.price = price * productItem.quantity; // Update the price of the item in the cart
cart.items[itemIndex] = productItem;
} else {
cart.items.push({ productId, name, quantity, price: price * quantity });
}

Stripe API key is Not defined

I tried to clone the repository and tried running it but couldn't as i was getting an error saying stripe api key isn't defined in config, could you tell a fix for that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.