add-cart-discount

star 10

Add per-item discount support to the cart total

zernie By zernie schedule Updated 6/8/2026

name: add-cart-discount description: Add per-item discount support to the cart total

Add per-item discounts

total(items) in src/cart.js sums price * qty across the cart.

Add support for an optional discount field on an item — a percentage off that item's line total. For example an item { price: 100, qty: 1, discount: 10 } contributes 90. Items without a discount field are unaffected.

The behaviour is covered by the tests under test/.

Install via CLI
npx skills add https://github.com/zernie/vigiles --skill add-cart-discount
Repository Details
star Stars 10
call_split Forks 1
navigation Branch main
article Path SKILL.md
More from Creator