-
Notifications
You must be signed in to change notification settings - Fork 1
Frontend Cart Auto-Empty + Quantity Refactor #58
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
base: main
Are you sure you want to change the base?
Conversation
…ti/curaise into arsh-frontend-cart
… fundraiserId is present
…centered properly
…mponents to use local cart state instead of store method
|
Chelsea She seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
✅ Deploy Preview for curaise ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Arsh, nice fix! I just have two small nitpicks, but after those are addressed, the PR should be good to merge!
| if ((!cartItems || cartItems.length === 0) && !orderPlaced) { | ||
| // If cart is empty and no order was just placed, redirect to the fundraiser page | ||
| redirect(`/buyer/fundraiser/${fundraiser.id}`); | ||
| return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this return null; line?
| <div className="flex justify-between"> | ||
| <span className="font-medium">Items</span> | ||
| <span className="font-bold">{totalItems}</span> | ||
| </div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need items count if it's already shown in the navbar
This PR refactors the buyer cart logic to improve accuracy and usability. The cart now automatically clears after a successful order and displays total item quantities instead of just unique item counts.
Changes
BuyerNavbar.tsx:ShoppingCart.tsx:CheckoutForm.tsx:Cart Quantity

Cart Modal
