Skip to content

[ECSoC_2026] feat: Implement Advanced Shopping Cart Engine & Dynamic Order Calculation #417

Description

@Babin123456

Problem

The shopping cart previously lacked structured line item calculation rules, promotional discount code evaluation, dynamic tax computation (8%), threshold shipping logic ($25 under $500, Free over $500), and custom event dispatching across client tabs.

Current Behavior

Cart totals relied on hardcoded math inside app.js without promo code input capabilities or modular currency formatting.

Why This Improvement Is Needed

E-commerce storefronts require reliable calculation rules, promotional coupon integration, and real-time state synchronization to deliver an engaging user experience.

Proposed Solution

  1. Create scripts/cart-calculator.js for pure functional calculation of line totals, discounts (FURNIX10, ECSOC2026), shipping fees, and USD formatting.
  2. Create scripts/cart-engine.js for stateful localStorage item manipulation, quantity bounds (1-99), item removal, and custom DOM event notifications (furnix:cart-updated).
  3. Update cart.html, app.js, and style.css to render promo code inputs and breakdown summaries.
  4. Remove legacy redundant Furnix-main/cart.html.

Expected Outcome

  • Accurate, extensible cart calculation engine with promotional code support.
  • Real-time cart badge updates across all open tabs.
  • Clean code architecture separating calculation logic from DOM views.

Additional Notes

Tested against Node.js runtime and browser local storage environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions