FreeProduct
class FreeProduct extends AbstractRemoveOnProducts
Allow to remove an amount from the checkout total
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 |
CATEGORY_ID |
|
PRODUCTS_LIST |
|
OFFERED_PRODUCT_ID |
|
OFFERED_CATEGORY_ID |
|
ADD_TO_CART_IN_PROCESS |
This constant is user to mark a free product as in the process of being added to the cart, but the CartItem ID is not yet been defined. |
Properties
$category_id | from AbstractRemoveOnProducts | ||
$product_list | from AbstractRemoveOnProducts |
Methods
No 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
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
Check if the Coupon can be used against a product already with a special offer price
Return how many time the Coupon can be used again Ex : -1 unlimited
We overload this method here to remove the free products when the coupons conditions are no longer met.
This is the field label than will be displayed in the form.
No description
No description
No description
No description
No description
Get I18n name
No description
Details
in
CouponAbstract at line 120
__construct(
FacadeInterface $facade)
Constructor
in
CouponAbstract at line 134
$this
setOrganizer(
ConditionOrganizerInterface $organizer)
Set Condition Organizer
in
AbstractRemoveOnProducts at line 51
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)
in
CouponAbstract at line 190
$this
setPerCustomerUsageCount(
true $perCustomerUsageCount)
in
CouponAbstract at line 200
boolean
getPerCustomerUsageCount()
in
CouponAbstract at line 210
string
getCode()
Return Coupon code (ex: XMAS)
in
CouponAbstract at line 220
string
getTitle()
Return Coupon title (ex: Coupon for XMAS)
in
CouponAbstract at line 230
string
getShortDescription()
Return Coupon short description
in
CouponAbstract at line 240
string
getDescription()
Return Coupon description
in
CouponAbstract 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
in
CouponAbstract at line 262
bool
isRemovingPostage()
If Coupon is removing Checkout Postage
in
CouponAbstract at line 270
ObjectCollection
getFreeShippingForCountries()
in
CouponAbstract at line 278
ObjectCollection
getFreeShippingForModules()
at line 178
float
exec()
in
CouponAbstract at line 296
ConditionCollection
getConditions()
Return condition to validate the Coupon or not
in
CouponAbstract 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
in
CouponAbstract at line 322
DateTime
getExpirationDate()
Return Coupon expiration date
in
CouponAbstract at line 333
boolean
isAvailableOnSpecialOffers()
Check if the Coupon can be used against a product already with a special offer price
in
CouponAbstract at line 343
boolean
isEnabled()
Check if Coupon has been disabled by admin
in
CouponAbstract at line 354
int
getMaxUsage()
Return how many time the Coupon can be used again Ex : -1 unlimited
in
CouponAbstract at line 364
bool
isExpired()
Check if the Coupon is already Expired
in
CouponAbstract at line 381
string
getServiceId()
Get Coupon Manager service Id
at line 163
bool
isMatching()
We overload this method here to remove the free products when the coupons conditions are no longer met.
in
CouponAbstract 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 311
string
drawBackOfficeInputs()
in
CouponAbstract at line 495
array
getEffects(
array $data)
Create the effect array from the list of fields
at line 325
clear()
in
CouponAbstract at line 514
bool
isInUse()
at line 49
setFieldsValue(
Array $effects)
at line 58
float
getCartItemDiscount(
CartItem $cartItem)
in
AbstractRemoveOnProducts at line 125
string
drawBaseBackOfficeInputs(
string $templateName,
array $otherFields)
in
AbstractRemoveOnProducts at line 143
getBaseFieldList($otherFields)
in
AbstractRemoveOnProducts at line 151
checkBaseCouponFieldValue($fieldName, $fieldValue)
at line 286
string
getName()
Get I18n name