Search by

pantono / cart

csburton

Cart Module for pantono

Package info

github.com/pantono/cart

pkg:composer/pantono/cart

Statistics

Installs: 235

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.125 2026-12-01 20:21 UTC

README

Use Cart::addCode($code, $productDiscounts, $customerId) to validate and add a code. Pass null for a guest. Invalid codes throw DiscountCodeInvalidException; an already-applied discount is a successful no-op. Call ShoppingCart::validateCodes($cart, $customerId) when loading a cart and before payment. It removes invalid codes, saves the cart when necessary, and returns entries containing code, reason, and message.

Discount minimum and maximum spend are inclusive bounds on the net goods total, excluding VAT and delivery. A null maximum has no upper bound; above a non-null max_spend the discount does not apply. Goods and delivery discounts are capped at the remaining corresponding net total when discounts are stacked.