interface DiscountManagerInterface (View source)

Methods

addType(string $classname)

Add a discount type by classname

Collection
getTypes()

Return the available discount types.

addApplied(CartDiscount $cartDiscount)

Add an applied discount

Collection
getApplied()

Return the applied discounts

apply(Cart $cart)

Apply discounts for a given cart.

bool
validateCoupon(string $coupon)

Validate a given coupon against all system discounts.

Details

DiscountManagerInterface addType(string $classname)

Add a discount type by classname

Parameters

string $classname

Return Value

DiscountManagerInterface

Collection getTypes()

Return the available discount types.

Return Value

Collection

DiscountManagerInterface addApplied(CartDiscount $cartDiscount)

Add an applied discount

Parameters

CartDiscount $cartDiscount

Return Value

DiscountManagerInterface

Collection getApplied()

Return the applied discounts

Return Value

Collection

Cart apply(Cart $cart)

Apply discounts for a given cart.

Parameters

Cart $cart

Return Value

Cart

bool validateCoupon(string $coupon)

Validate a given coupon against all system discounts.

Parameters

string $coupon

Return Value

bool