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
- Create
scripts/cart-calculator.js for pure functional calculation of line totals, discounts (FURNIX10, ECSOC2026), shipping fees, and USD formatting.
- Create
scripts/cart-engine.js for stateful localStorage item manipulation, quantity bounds (1-99), item removal, and custom DOM event notifications (furnix:cart-updated).
- Update
cart.html, app.js, and style.css to render promo code inputs and breakdown summaries.
- 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.
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.jswithout 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
scripts/cart-calculator.jsfor pure functional calculation of line totals, discounts (FURNIX10,ECSOC2026), shipping fees, and USD formatting.scripts/cart-engine.jsfor statefullocalStorageitem manipulation, quantity bounds (1-99), item removal, and custom DOM event notifications (furnix:cart-updated).cart.html,app.js, andstyle.cssto render promo code inputs and breakdown summaries.Furnix-main/cart.html.Expected Outcome
Additional Notes
Tested against Node.js runtime and browser local storage environments.