feat: add delete button product #219
Merged
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.
Related task(s)/issue(s) 🔗
Description 📋
To enhance user experience and give more control over their shopping cart 🛒, allow users to remove a product directly from the product page if it is already in their shopping cart.
🔨🧰 Implementation Details
Product Presence Check 🕵️♂️: Check if the product is already present in the user's shopping cart.
"Remove from Cart" Button ➖🛒: If the product is already in the shopping cart, provide an active and clickable "Remove from Cart" button on the product page. Clicking this should remove the product from the user's shopping cart.
API Integration 🔄💻: Use the chosen API to manage the shopping cart and remove products from it.
✅🎯 Acceptance Criteria
The application correctly identifies whether a product is already in the user's shopping cart when viewing the product page.
If the product is already in the shopping cart, a "Remove from Cart" button is visible and active on the product page.
Clicking the "Remove from Cart" button triggers an API call to remove the corresponding product from the user's shopping cart.
After successful removal, the user receives a confirmation message or visual cue.
The application handles API errors gracefully, showing appropriate error messages if the removal operation fails.
Done / deadline 📅
01.05.2024 / 18.06.2024
Screenshot/Illustration (optional) 📌
Comments (optional) 💬