e-commerce-store icon indicating copy to clipboard operation
e-commerce-store copied to clipboard

cart item price increase as the quantity increases.

Open codersam10 opened this issue 1 year ago • 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

codersam10 avatar Apr 29 '23 04:04 codersam10

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.

MohitSojitra avatar May 01 '23 04:05 MohitSojitra