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

Add product items cart #6

Merged
merged 2 commits into from
Dec 20, 2022
Merged

Add product items cart #6

merged 2 commits into from
Dec 20, 2022

Conversation

TrumanH
Copy link
Owner

@TrumanH TrumanH commented Dec 20, 2022

Description

Add product items to shopping cart leveraging the cart context.

  • Add cartItems field to cart context, accompanied the manipulate function addItem.
  • Update the cart drop down box with added product items, which with additional field qauntity compare to product page.
  • When adding item into the cart, if existing item with same id, increase quantity, otherwise, add new item.
  • Add effect hoock to calculate the total quantity in the CartContext.
  • Show total quantity in the cart icon.

@TrumanH TrumanH self-assigned this Dec 20, 2022
@TrumanH TrumanH merged commit fd3bc49 into main Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant