Skip to content

Add Dynamic “Add to Cart” Button with Quantity Controls #110

@Alexandrbig1

Description

@Alexandrbig1

Priority: High
Difficulty: Intermediate
Type: Frontend (React + Tailwind)


Description:
Update the “Add to Cart” functionality to dynamically reflect product quantity and improve user experience.
When a user clicks “Add to Cart”, the product should automatically open the cart menu (linking to the existing cart feature task).
The button text should change dynamically to show quantity controls (+ / ) and update the cart state in real-time.


Requirements:

  • Replace “Add to Cart” with quantity controls once an item is added:
    • Example: Quantity: 1 [ + ] [ – ]
  • On + → increase quantity in cart.
  • On → decrease quantity in cart.
    • If quantity becomes 0, revert back to “Add to Cart”.
  • Ensure consistency across:
    • All Products page
    • Garage Sale page
    • Collections pages (/collections/:name)
  • Make the quantity control a reusable component (e.g., AddToCartButton.tsx) and import it into all product cards.
  • Integrate with Redux (or current cart state logic).

Assets:

Image

Image


Acceptance Criteria:

  • “Add to Cart” updates to quantity controls dynamically.
  • Quantity changes reflect instantly in cart menu and global state.
  • Works seamlessly across all product listing pages.
  • Code is modular and reusable (no repetition between pages).
  • Follows project ESLint/Prettier and responsive design rules.

Notes:

This task complements the cart menu feature. The cart menu should open automatically when a product is added to the cart.

Metadata

Metadata

Assignees

Labels

advancedComplex/advanced tasks or featuresfrontendTasks related to the frontend (React, Vite, TailwindCSS, UI components, pages)hacktoberfestSpecial issue for Hacktoberfesthacktoberfest-2025Special issue for Hacktoberfest 2025priority: highNeeds attention ASAPreactReact components & UI logic
No fields configured for Feature.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions