class CouponManager

Manage how Coupons could interact with a Checkout

Methods

__construct( ContainerInterface $container)

Constructor

float
getDiscount()

Get Discount for the given Coupons

mixed|void
pushCouponInSession($code)

No description

bool
isCouponRemovingPostage( Order $order)

Check if there is a Coupon removing Postage

array
getCouponsKept()

No description

addAvailableCoupon( CouponInterface $coupon)

Add an available CouponManager (Services)

array
getAvailableCoupons()

Get all available CouponManagers (Services)

addAvailableCondition( ConditionInterface $condition)

Add an available ConstraintManager (Services)

array
getAvailableConditions()

Get all available ConstraintManagers (Services)

clear()

Clear all data kept by coupons

int
decrementQuantity( Coupon $coupon, int|null $customerId = null)

Decrement this coupon quantity

Details

at line 54
__construct( ContainerInterface $container)

Constructor

Parameters

ContainerInterface $container Service container

at line 65
float getDiscount()

Get Discount for the given Coupons

Return Value

float checkout discount

at line 91
mixed|void pushCouponInSession($code)

Parameters

$code

Return Value

mixed|void

at line 103
bool isCouponRemovingPostage( Order $order)

Check if there is a Coupon removing Postage

Parameters

Order $order the order for which we have to check if postage is free

Return Value

bool

at line 175
array getCouponsKept()

Return Value

array

at line 261
addAvailableCoupon( CouponInterface $coupon)

Add an available CouponManager (Services)

Parameters

CouponInterface $coupon CouponManager

at line 271
array getAvailableCoupons()

Get all available CouponManagers (Services)

Return Value

array

at line 281
addAvailableCondition( ConditionInterface $condition)

Add an available ConstraintManager (Services)

Parameters

ConditionInterface $condition ConditionInterface

at line 291
array getAvailableConditions()

Get all available ConstraintManagers (Services)

Return Value

array

at line 299
clear()

Clear all data kept by coupons

at line 319
int decrementQuantity( Coupon $coupon, int|null $customerId = null)

Decrement this coupon quantity

To call when a coupon is consumed

Parameters

Coupon $coupon Coupon consumed
int|null $customerId the ID of the ordering customer

Return Value

int Usage left after decremental