MohitSojitra/e-commerce-store

cart item price increase as the quantity increases.

Opened this issue · 1 comments

How can i make increment in the cart item price here (shown in the image) as the quantity of a single cart item increases?

Screenshot1

How can i make increment in the cart item price here (shown in the image) as the quantity of a single cart item increases?

Screenshot1

@codersam10

Regarding your question about incrementing the cart item price as the quantity of a single cart item increases, you can retrieve the item price from the redux store and use it to calculate the total price based on the quantity. I would suggest referring to the cartScreen.js file to see how the getCartSubTotal function works for more context.

However, I would also like to share my thoughts on this approach. Instead of updating the price to reflect the total amount, it might be better to display the single item price alongside the quantity. This will ensure that the user has a clear understanding of the cost of each individual item, and will avoid confusion if they come back to the cart page after a few days. This will provide a better user experience overall.

I hope this suggestion helps. Please let me know if you have any other questions or concerns.

Thanks.