Added Quantity Selection, Total Price Display, and User Name on Navigation Bar #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request adds several new features to the e-commerce website, enhancing the user experience and providing important information. The features include the ability for users to select the quantity of items in their cart, display the total price dynamically, show the username on the navigation bar, and present the count of items in the cart.
Approach
To implement the quantity selection feature, I added an input field next to each item in the cart, allowing users to input the desired quantity. This information is then used to update the total price dynamically, which is displayed prominently on the checkout page.
To show the username on the navigation bar, I modified the header component to fetch the username from the user's account and display it in the appropriate location. This personalization helps users feel more connected to the platform.
Furthermore, I added a cart icon with a badge that shows the count of items in the cart. This allows users to quickly see how many items they have added to their cart, even when they are navigating different pages on the website.
Testing
I thoroughly tested these new features on various browsers and devices to ensure they work reliably. I conducted unit tests for the quantity selection functionality and cross-checked the total price calculations. Additionally, I tested the display of the username on different screen sizes and verified that the cart count updates accurately.
Documentation
I updated the project's documentation to reflect these new features, providing clear instructions on how to use the quantity selection, understand the total price, and interpret the cart count. All screenshots are available in the project's repository under the "screenshots" folder.
This contribution aims to improve the usability and overall user experience of the e-commerce website. By providing quantity selection, total price display, and user personalization, users can have a more convenient and informative shopping experience. I look forward to receiving feedback from the project maintainers and community members.