class CouponCreateOrUpdateEvent extends ActionEvent

Occurring when a Coupon is created or updated

Methods

__set($name, $value)

No description

__get($name)

No description

bindForm( Form $form)

No description

__construct( string $code, string $serviceId, string $title, array $effects, string $shortDescription, string $description, bool $isEnabled, DateTime $expirationDate, boolean $isAvailableOnSpecialOffers, boolean $isCumulative, boolean $isRemovingPostage, int $maxUsage, string $locale, array $freeShippingForCountries, array $freeShippingForMethods, boolean $perCustomerUsageCount, DateTime $startDate = null)

Constructor

setPerCustomerUsageCount( true $perCustomerUsageCount)

No description

true
getPerCustomerUsageCount()

No description

$this
setFreeShippingForCountries( array $freeShippingForCountries)

No description

array
getFreeShippingForCountries()

No description

$this
setFreeShippingForMethods( array $freeShippingForMethods)

No description

array
getFreeShippingForMethods()

No description

string
getCode()

Return Coupon code (ex: XMAS)

string
getTitle()

Return Coupon title (ex: Coupon for XMAS)

string
getShortDescription()

Return Coupon short description

string
getDescription()

Return Coupon description

bool
isCumulative()

If Coupon is cumulative or prevent any accumulation If is cumulative you can sum Coupon effects If not cancel all other Coupon and take the last given

bool
isRemovingPostage()

If Coupon is removing Checkout Postage

float
getAmount()

Return effects generated by the coupon

getStartDate()

Return Coupon start date

getExpirationDate()

Return Coupon expiration date

boolean
isAvailableOnSpecialOffers()

If Coupon is available on special offers

boolean
isEnabled()

Get if Coupon is enabled or not

int
getMaxUsage()

Return how many time the Coupon can be used again Ex : -1 unlimited

string
getServiceId()

Get Coupon Service id (Type)

string
getLocale()

Coupon Language code ISO (ex: fr_FR)

setEffects( array $effects)

Set effects ready to be serialized

array
getEffects()

Get effects ready to be serialized

boolean
getIsAvailableOnSpecialOffers()

Get if the Coupon will be available on special offers or not

boolean
getIsCumulative()

Get if the Coupon effect cancel other Coupon effects

boolean
getIsEnabled()

Get if Coupon is enabled or not

boolean
getIsRemovingPostage()

No description

$this
setCouponModel( Coupon $couponModel)

Set Coupon Model

getCouponModel()

Return Coupon Model

getConditions()

Get Conditions

$this
setConditions( ConditionCollection $conditions)

Set Conditions

Details

in ActionEvent at line 30
__set($name, $value)

Parameters

$name
$value

in ActionEvent at line 35
__get($name)

Parameters

$name

in ActionEvent at line 44
bindForm( Form $form)

Parameters

Form $form

at line 111
__construct( string $code, string $serviceId, string $title, array $effects, string $shortDescription, string $description, bool $isEnabled, DateTime $expirationDate, boolean $isAvailableOnSpecialOffers, boolean $isCumulative, boolean $isRemovingPostage, int $maxUsage, string $locale, array $freeShippingForCountries, array $freeShippingForMethods, boolean $perCustomerUsageCount, DateTime $startDate = null)

Constructor

Parameters

string $code Coupon Code
string $serviceId Coupon Service id
string $title Coupon title
array $effects Coupon effects ready to be serialized 'amount' key is mandatory and reflects the amount deduced from the cart
string $shortDescription Coupon short description
string $description Coupon description
bool $isEnabled Enable/Disable
DateTime $expirationDate Coupon expiration date
boolean $isAvailableOnSpecialOffers Is available on special offers
boolean $isCumulative Is cumulative
boolean $isRemovingPostage Is removing Postage
int $maxUsage Coupon quantity
string $locale Coupon Language code ISO (ex: fr_FR)
array $freeShippingForCountries ID of Countries to which shipping is free
array $freeShippingForMethods ID of Shipping modules for which shipping is free
boolean $perCustomerUsageCount Usage count is per customer
DateTime $startDate Coupon start date

at line 152
setPerCustomerUsageCount( true $perCustomerUsageCount)

Parameters

true $perCustomerUsageCount

at line 162
true getPerCustomerUsageCount()

Return Value

true

at line 171
$this setFreeShippingForCountries( array $freeShippingForCountries)

Parameters

array $freeShippingForCountries

Return Value

$this

at line 181
array getFreeShippingForCountries()

Return Value

array

at line 190
$this setFreeShippingForMethods( array $freeShippingForMethods)

Parameters

array $freeShippingForMethods

Return Value

$this

at line 200
array getFreeShippingForMethods()

Return Value

array

at line 210
string getCode()

Return Coupon code (ex: XMAS)

Return Value

string

at line 220
string getTitle()

Return Coupon title (ex: Coupon for XMAS)

Return Value

string

at line 230
string getShortDescription()

Return Coupon short description

Return Value

string

at line 240
string getDescription()

Return Coupon description

Return Value

string

at line 252
bool isCumulative()

If Coupon is cumulative or prevent any accumulation If is cumulative you can sum Coupon effects If not cancel all other Coupon and take the last given

Return Value

bool

at line 262
bool isRemovingPostage()

If Coupon is removing Checkout Postage

Return Value

bool

at line 272
float getAmount()

Return effects generated by the coupon

Return Value

float Amount removed from the Total Checkout

at line 282
DateTime getStartDate()

Return Coupon start date

Return Value

DateTime

at line 295
DateTime getExpirationDate()

Return Coupon expiration date

Return Value

DateTime

at line 305
boolean isAvailableOnSpecialOffers()

If Coupon is available on special offers

Return Value

boolean

at line 315
boolean isEnabled()

Get if Coupon is enabled or not

Return Value

boolean

at line 326
int getMaxUsage()

Return how many time the Coupon can be used again Ex : -1 unlimited

Return Value

int

at line 336
string getServiceId()

Get Coupon Service id (Type)

Return Value

string

at line 346
string getLocale()

Coupon Language code ISO (ex: fr_FR)

Return Value

string

at line 359
setEffects( array $effects)

Set effects ready to be serialized

Parameters

array $effects Effect ready to be serialized Needs at least the key 'amount' with the amount removed from the cart

Exceptions

InvalidArgumentException

at line 372
array getEffects()

Get effects ready to be serialized

Return Value

array

at line 382
boolean getIsAvailableOnSpecialOffers()

Get if the Coupon will be available on special offers or not

Return Value

boolean

at line 392
boolean getIsCumulative()

Get if the Coupon effect cancel other Coupon effects

Return Value

boolean

at line 402
boolean getIsEnabled()

Get if Coupon is enabled or not

Return Value

boolean

at line 410
boolean getIsRemovingPostage()

Return Value

boolean

at line 422
$this setCouponModel( Coupon $couponModel)

Set Coupon Model

Parameters

Coupon $couponModel Coupon Model

Return Value

$this

at line 434
Coupon getCouponModel()

Return Coupon Model

Return Value

Coupon

at line 444
null|ConditionCollection getConditions()

Get Conditions

Return Value

null|ConditionCollection Array of ConditionInterface

at line 456
$this setConditions( ConditionCollection $conditions)

Set Conditions

Parameters

ConditionCollection $conditions Array of ConditionInterface

Return Value

$this