StealThis .dev
Pages Medium

Shop — Cart / Bag

A polished e-commerce cart and bag page with line items showing product silhouette thumbnails, variant, quantity steppers, and per-line pricing. A promo-code field with live validation, an order summary breaking down subtotal, discount, shipping, and estimated tax, plus a free-shipping progress bar and a sticky secure-checkout panel with trust signals. Quantity edits recompute every total, removing an item offers an undo toast, and an empty-bag state ships built in.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Cart / Bag

A clean white, ink, and single-accent shopping bag page. Each line item pairs a gradient product tile with an inline-SVG silhouette, the product title and variant, a low-stock chip, a quantity stepper, a remove link, and right-aligned per-line pricing with strike-through original prices on sale items. A free-shipping progress bar at the top fills as the subtotal climbs toward the threshold and flips to a celebratory state once unlocked.

The sticky summary panel holds a promo-code input with quick-fill chips, an itemized totals list (subtotal, discount, shipping, estimated tax, total), and a prominent secure-checkout button that mirrors the running total. Trust signals — encrypted checkout, free returns, fast shipping — sit beneath the call to action.

Every interaction is real and self-contained in vanilla JS. Changing a quantity recomputes the subtotal, tax, shipping, and total instantly; the stepper enforces a minimum of one and respects per-item stock. Removing an item animates it out and surfaces an undo toast for a few seconds. Valid codes SAVE15 (15% off) and FREESHIP (free shipping) apply discounts with inline validation, and emptying the bag reveals a dedicated empty state. All money is formatted as $1,299.00.

Illustrative storefront UI only — fictional products, prices, and reviews. No real checkout.