CartCondition
abstract class CartCondition implements Arrayable, Jsonable, Serializable
CartCondition class
Traits
Properties
protected Collection | $actionCollection | from CartConditionHelper | |
string | $name | The name for this cart condition. |
|
int|float | $label | The label for this cart condition. |
|
int | $priority | The priority for this cart condition. |
|
$removeable | |||
protected | $sessionKey | ||
protected | $cartInstance | ||
protected CartContent|CartItem | $target | ||
protected | $passed | ||
protected | $calculatedValue | ||
protected array | $config | The config for this cart condition. |
Methods
CartItem constructor.
No description
No description
No description
No description
Apply condition to cart content
Get the calculated the value of this condition Used internally when applying to cart item
Called before condition is loaded into cart session
Called before the applying of condition on the entire cart.
Called after the applying of condition on the entire cart.
Returns the rules for this cart condition.
Returns the actions for this cart condition.
Called once when the condition validation passes.
Called once when the condition validation fails.
No description
No description
No description
No description
No description
No description
Set the order in which this condition is applied.
No description
No description
No description
No description
No description
No description
Get the instance as an array.
Convert the object to its JSON representation.
String representation of object
Constructs the object
Details
in
CartConditionHelper at line 14
protected
validate($rules)
No description
in
CartConditionHelper at line 35
protected float|string
processValue($subTotal)
Added for backward compatibility
in
CartConditionHelper at line 40
protected
processActionValue($action, $total)
No description
in
CartConditionHelper at line 62
protected
calculateActionValue($action, $total)
No description
in
CartConditionHelper at line 96
protected
actionHasReachedMax($actionMax, $value)
No description
in
CartConditionHelper at line 109
protected mixed
cleanValue($value)
Removes some arithmetic signs (%,+,-, /, *) only
in
CartConditionHelper at line 114
protected
operandValue($key)
No description
in
CartConditionHelper at line 125
protected
ruleIsValid($rule)
No description
in
CartConditionHelper at line 151
protected
parseRule($rule)
No description
in
CartConditionHelper at line 163
protected
parseAction($action)
No description
in
CartConditionHelper at line 174
protected
actionIsInclusive($action)
No description
in
CartConditionHelper at line 186
protected bool
valueIsPercentage($value)
Check if value is a percentage
in
CartConditionHelper at line 198
protected bool
valueIsToBeSubtracted($value)
Check if value is a subtract
in
CartConditionHelper at line 210
protected bool
valueIsToBeAdded($value)
Check if value is to be added
in
CartConditionHelper at line 222
protected bool
valueIsToBeMultiplied($value)
Check if value is to be added
in
CartConditionHelper at line 234
protected bool
valueIsToBeDivided($value)
Check if value is to be added
in
CartConditionHelper at line 243
protected
getSessionKey()
No description
at line 75
__construct(array $config = [])
CartItem constructor.
at line 81
fillFromConfig($config)
No description
at line 93
isValid()
No description
at line 98
isApplied()
No description
at line 103
isInclusive()
No description
at line 119
float|string
apply($subTotal)
Apply condition to cart content
at line 140
float|string
calculate($subTotal)
Get the calculated the value of this condition Used internally when applying to cart item
at line 160
onLoad()
Called before condition is loaded into cart session
at line 167
beforeApply()
Called before the applying of condition on the entire cart.
at line 174
afterApply()
Called after the applying of condition on the entire cart.
at line 183
array
getRules()
Returns the rules for this cart condition.
at line 193
array
getActions()
Returns the actions for this cart condition.
at line 201
whenValid()
Called once when the condition validation passes.
at line 208
whenInvalid()
Called once when the condition validation fails.
at line 216
withTarget($target)
No description
at line 223
setCartContent($cartContent)
No description
at line 230
getCartContent()
No description
at line 237
getLabel()
No description
at line 242
getValue()
No description
at line 247
getPriority()
No description
at line 257
setPriority(int $priority = 999)
Set the order in which this condition is applied.
at line 262
protected
getConfig($key, $default = null)
No description
at line 267
protected
setConfig($key, $value)
No description
at line 272
getMetaData($key = null, $default = null)
No description
at line 281
setMetaData($key, $value = null)
No description
at line 297
removeMetaData($key = null)
No description
at line 311
clearMetaData()
No description
at line 325
array
toArray()
Get the instance as an array.
at line 343
string
toJson(int $options = 0)
Convert the object to its JSON representation.
at line 351
serialize()
String representation of object
at line 363
void
unserialize(string $serialized)
Constructs the object