Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix : Implement Dynamic Price Calculation in CartItems #86

Merged

Conversation

ramith-kulal
Copy link
Contributor

Title and Issue number

Title : Resolving Issues regarding Cart section.

Issue No. : #85
Close #85

This pull request introduces dynamic price calculation in the CartItems component to accurately reflect the total price based on the quantity of each item in the shopping cart. Previously, the price displayed was static and did not consider the quantity of each item.

Changes Made

  • Added a new function calculateTotalPrice in the CartItems component to compute the total price for each item based on its - quantity and price.
  • Updated the rendering logic to display the total price for each item dynamically.
  • Adjusted the getTotalCartAmount function in the ShopContextProvider to properly calculate the total cart amount by summing up the prices of all items considering their quantities.

These changes ensure that the subtotal and total prices in the cart are accurately calculated, taking into account the quantity of each item. This enhances the user experience by providing a more realistic representation of the shopping cart contents and the total cost.
[List the specific changes made in this pull request.]

Screenshots (if applicable)

[Include any relevant screenshots or images to support your changes.]

Screenshot 2024-02-21 120417
Screenshot 2024-02-21 120359

Checklist

  • I have tested these changes locally.
  • I have reviewed the code and ensured it follows the project's coding standards.
  • I have updated the documentation (if necessary).
  • I have read the contributing guidelines.
  • working under jwoc

Copy link

vercel bot commented Feb 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
shop-nex ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2024 6:47am

@JiyaGupta-cs JiyaGupta-cs merged commit c5d535d into JiyaGupta-cs:master Feb 21, 2024
2 of 3 checks passed
@JiyaGupta-cs
Copy link
Owner

@ramith-kulal
image
you need to multiply the quantity with price also

@JiyaGupta-cs
Copy link
Owner

@ramith-kulal Make one more PR

@ramith-kulal
Copy link
Contributor Author

@ramith-kulal image you need to multiply the quantity with price also

i guess its working fine should i re check that?

@JiyaGupta-cs
Copy link
Owner

Oh fine
I got confused
No problem
I'll merge it

@JiyaGupta-cs
Copy link
Owner

@ramith-kulal
See , are your points rewarded , check in the leaderboard

@JiyaGupta-cs
Copy link
Owner

@ramith-kulal
Open a new issue for changing the position of submit button
I'll assign you there also

@ramith-kulal
Copy link
Contributor Author

@ramith-kulal See , are your points rewarded , check in the leaderboard

well leaderboard isnt updated yet , i hope points will be added. 😁

@ramith-kulal
Copy link
Contributor Author

@ramith-kulal Open a new issue for changing the position of submit button I'll assign you there also

got you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Cart Total Sum Calculation
2 participants