CouponAbstract
class CouponAbstract implements CouponInterface
Assist in writing a CouponInterface
Constants
COUPON_DATASET_NAME |
The dataset name for all coupon specific input fields, that do not appear in the CouPonCreationForm form. In the input form, these fields have to be created like: theliacouponspecific[myfield, theliacouponcreationextended[myotherfield] use the makeCouponField() method to do that safely. |
AMOUNT_FIELD_NAME |
A standard 'amount' filed name, thant can be used in coupons which extends this class |
Methods
Constructor
No description
No description
No description
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
No description
No description
No description
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 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
Get Coupon Manager service Id
Check if the current state of the application is matching this Coupon conditions Thelia variables are given by the FacadeInterface
This is the field label than will be displayed in the form.
Draw the input displayed in the BackOffice allowing Admin to set its Coupon effect Override this method to do something useful
Create the effect array from the list of fields
No description
No description
Details
at line 120
__construct(
FacadeInterface $facade)
Constructor
at line 134
$this
setOrganizer(
ConditionOrganizerInterface $organizer)
Set Condition Organizer
at line 144
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)
at line 190
$this
setPerCustomerUsageCount(
true $perCustomerUsageCount)
at line 200
boolean
getPerCustomerUsageCount()
at line 210
string
getCode()
Return Coupon code (ex: XMAS)
at line 220
string
getTitle()
Return Coupon title (ex: Coupon for XMAS)
at line 230
string
getShortDescription()
Return Coupon short description
at line 240
string
getDescription()
Return Coupon description
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
at line 262
bool
isRemovingPostage()
If Coupon is removing Checkout Postage
at line 270
ObjectCollection
getFreeShippingForCountries()
at line 278
ObjectCollection
getFreeShippingForModules()
at line 286
float
exec()
at line 296
ConditionCollection
getConditions()
Return condition to validate the Coupon or not
at line 310
$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 322
DateTime
getExpirationDate()
Return Coupon expiration date
at line 333
boolean
isAvailableOnSpecialOffers()
Check if the Coupon can be used against a product already with a special offer price
at line 343
boolean
isEnabled()
Check if Coupon has been disabled by admin
at line 354
int
getMaxUsage()
Return how many time the Coupon can be used again Ex : -1 unlimited
at line 364
bool
isExpired()
Check if the Coupon is already Expired
at line 381
string
getServiceId()
Get Coupon Manager service Id
at line 392
bool
isMatching()
Check if the current state of the application is matching this Coupon conditions Thelia variables are given by the FacadeInterface
at line 405
string
getInputName()
This is the field label than will be displayed in the form.
This method should be overridden to be useful.
For backward compatibility only.
at line 417
string
drawBackOfficeInputs()
Draw the input displayed in the BackOffice allowing Admin to set its Coupon effect Override this method to do something useful
at line 495
array
getEffects(
array $data)
Create the effect array from the list of fields