Add per-item discount support to the cart total
Scanned 9/3/2026
Install to Claude Code
npx -y skills add zernie/vigiles --skill cart-discount --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Cart Discount?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/zernie-cart-discount)More formats (shields.io, HTML) on the badges page.
---
name: add-cart-discount
description: Add per-item discount support to the cart total
---
<!-- vigiles:result "npm test" -->
# 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/`.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!