CouponInterface
interface CouponInterface
Represents a Coupon ready to be processed in a Checkout process
Methods
Get I18n name
Get I18n tooltip
Get Coupon Manager service Id
Set Coupon
Return Coupon code (ex: XMAS)
Return Coupon title (ex: Coupon for XMAS)
Return Coupon short description
Return Coupon description
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
If Coupon is removing Checkout Postage
Return condition to validate the Coupon or not
Replace the existing Conditions by those given in parameter If one Condition is badly implemented, no Condition will be added
Return Coupon expiration date
Check if the Coupon can be used against a product already with a special offer price
Check if the Coupon can be used against a product already with a special offer price
Check if Coupon has been disabled by admin
Return how many time the Coupon can be used again Ex : -1 unlimited
Check if the Coupon is already Expired
Return an amount thant will be subtracted to the cart total, or zero.
Check if the current Coupon is matching its conditions Thelia variables are given by the FacadeInterface
Draw the input displayed in the BackOffice allowing Admin to set its Coupon effect
No description
No description
Create the effect array from the list of fields
Clear all the data the coupon may have stored, called after an order is completed.
No description
Details
at line 33
string
getName()
Get I18n name
at line 40
string
getToolTip()
Get I18n tooltip
at line 47
string
getServiceId()
Get Coupon Manager service Id
at line 69
set(
FacadeInterface $facade,
string $code,
string $title,
string $shortDescription,
string $description,
array $effects,
bool $isCumulative,
bool $isRemovingPostage,
bool $isAvailableOnSpecialOffers,
bool $isEnabled,
int $maxUsage,
DateTime $expirationDate,
ObjectCollection $freeShippingForCountries,
ObjectCollection $freeShippingForModules,
bool $perCustomerUsageCount)
Set Coupon
at line 92
string
getCode()
Return Coupon code (ex: XMAS)
at line 99
string
getTitle()
Return Coupon title (ex: Coupon for XMAS)
at line 106
string
getShortDescription()
Return Coupon short description
at line 113
string
getDescription()
Return Coupon description
at line 122
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
at line 129
bool
isRemovingPostage()
If Coupon is removing Checkout Postage
at line 136
ConditionCollection
getConditions()
Return condition to validate the Coupon or not
at line 147
$this
setConditions(
ConditionCollection $conditions)
Replace the existing Conditions by those given in parameter If one Condition is badly implemented, no Condition will be added
at line 154
DateTime
getExpirationDate()
Return Coupon expiration date
at line 162
boolean
isAvailableOnSpecialOffers()
Check if the Coupon can be used against a product already with a special offer price
at line 170
boolean
getPerCustomerUsageCount()
Check if the Coupon can be used against a product already with a special offer price
at line 177
boolean
isEnabled()
Check if Coupon has been disabled by admin
at line 185
int
getMaxUsage()
Return how many time the Coupon can be used again Ex : -1 unlimited
at line 192
bool
isExpired()
Check if the Coupon is already Expired
at line 205
float
exec()
Return an amount thant will be subtracted to the cart total, or zero.
This method could also perform something else than the calculating an amount to subtract from the cart. It may add a product to the cart, for example. In this case, an amount of 0 will be returned.
WARNING: this method could be called several times, so perform suitable checks before performing cart manipulations, so that the coupon effect will not be applied several times.
at line 213
bool
isMatching()
Check if the current Coupon is matching its conditions Thelia variables are given by the FacadeInterface
at line 221
string
drawBackOfficeInputs()
Draw the input displayed in the BackOffice allowing Admin to set its Coupon effect
at line 226
ObjectCollection
getFreeShippingForCountries()
at line 231
ObjectCollection
getFreeShippingForModules()
at line 240
array
getEffects(
array $data)
Create the effect array from the list of fields
at line 245
clear()
Clear all the data the coupon may have stored, called after an order is completed.