This package is abandoned and no longer maintained. No replacement package was suggested.

The missing link between your product pages and your payment gateway

2.0.5 2017-05-03 07:30 UTC

This package is auto-updated.

Last update: 2020-02-05 06:08:12 UTC


Build Status PHP from Packagist Latest Version License

This package is based on Basket by philipbrown.


Require this package, with Composer, in the root directory of your project.

$ composer require faustbrian/basket


Important: Coupons are applied AFTER Discounts! This means if you have applied a Discount and a Coupon the Coupon will be applied to the discounted price.


For usage instructions check the USAGE.md.

Create a coupon

$coupon = new Coupon('COUPON_NAME');
$coupon->add(new PercentageDiscount(20));
$coupon->add(new ValueDiscount(new Money(500, new Currency('GBP'))));

Apply a coupon


Serialize a coupon - Could be used when the coupon needs to be stored.


Quantity Discount

Grant 20% discount on each Product if more than 5 are purchased

$quantityDiscount = new PercentageDiscount(20);
$coupon->add(new QuantityDiscount(5, $quantityDiscount));

Grant 5£ discount on each Product if more than 5 are purchased

$quantityDiscount = new ValueDiscount(new Money(500, new Currency('GBP')));
$coupon->add(new QuantityDiscount(5, $quantityDiscount));


$ phpunit


If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.



MIT © Brian Faust