Skip to content

feat: Add Item Quantity Stepper (+ / - Buttons) in the Cart#307

Open
Dev1822 wants to merge 3 commits into
PatelHarsh2006:mainfrom
Dev1822:feat-cart-quantity-stepper
Open

feat: Add Item Quantity Stepper (+ / - Buttons) in the Cart#307
Dev1822 wants to merge 3 commits into
PatelHarsh2006:mainfrom
Dev1822:feat-cart-quantity-stepper

Conversation

@Dev1822
Copy link
Copy Markdown

@Dev1822 Dev1822 commented May 27, 2026

Close Issue #288

Description:
This PR activates the item quantity stepper inside the shopping cart. Previously, the + and - buttons were present in the UI but were non-functional and throwing errors due to references to undefined functions (saveCart and updateFavCount).

Changes made:

  • Fixed JavaScript ReferenceErrors blocking the cart's add/remove operations.
  • Wired the qty-increase (+) and qty-decrease (-) buttons to directly update the global cart state via cartManager.increaseQuantity() and cartManager.decreaseQuantity().
  • Updated the main "Remove" button to use cartManager.removeItem() for proper state management and storage synchronization.
  • Cleaned up dangling and unused function calls across main.js that were breaking cart operations (e.g. during checkout and reorder flows).

Testing Instructions:

  1. Open the menu and add an item to the cart.
  2. Open the cart sidebar and click the + button to verify the quantity and total price increase dynamically.
  3. Click the - button to verify the quantity decreases properly, and the item is removed if quantity drops below 1.
  4. Click the explicit "Remove" button to verify the item is entirely removed from the cart.

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