ModelDiscounts module
ProductCategoryCondition
Product category condition describes the conditions that need to be met for the discount to be applied, based on product category quantity or price that is in the current cart.
Set "quantityTo" or "amountTo" values to 0 to "exclude" the product category from the cart; i.e. when the added product of that category is in the cart, the discount is not applied.
NOTE if you exclude several categories, not to apply discount product(s) that belong to all of these categories, need to be in the cart: if you restricted PCs and Laptops categories, to fail condition, you need product(s) that belong to PCs and to Laptops on the cart.
A model in the Discounts module, with 21 members for templates, 18 API properties and 22 members for admin templates.
Templates view
Properties 21
Take no arguments.
-
#
getQuantityFrom() -
?int - Gets a minimum quantity of products (from the selected categories) that needs to be in the cart to apply the discount.
-
#
getQuantityTo() -
?int - Gets a maximum quantity of products (from the selected categories) that can be in the cart to apply the discount. Can be 0 to exclude any product (from the selected categories) from the cart.
-
#
isAllowed() -
bool - Checks if the condition set to allow a product category. If is allowed when not forbidden.
-
#
isForbidden() -
bool - Checks if the condition set to forbid a product category. It is forbidden when either "quantity to" or "amount to" are set to 0.
-
#
getAmountFrom() -
?string - Gets a minimum price of products (from the selected categories) that needs to be in the cart to apply the discount.
-
#
getAmountTo() -
?string - Gets a maximum price of products (from the selected categories) that can be in the cart to apply the discount.
-
#
getSnakeType() -
string - Returns the type of condition in the snake case format: lowercase and connected by underline
-
#
getSlugType() -
string - Returns the type of condition in the slug format: lowercase and connected by hyphen
-
#
getId() -
?int -
#
getName() -
?string -
#
getData() -
?array -
#
isActive() -
bool -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
No members match the filter.
API & Jobs view
API & JobsEach property is a key in REST API responses and job payloads. Its name is the template getter without get, is or has. Methods that need arguments are not available here.
Properties 18
Read-only values on the record.
-
#
quantityFrom -
?int - Gets a minimum quantity of products (from the selected categories) that needs to be in the cart to apply the discount.
-
#
quantityTo -
?int - Gets a maximum quantity of products (from the selected categories) that can be in the cart to apply the discount. Can be 0 to exclude any product (from the selected categories) from the cart.
-
#
allowed -
bool - Checks if the condition set to allow a product category. If is allowed when not forbidden.
-
#
forbidden -
bool - Checks if the condition set to forbid a product category. It is forbidden when either "quantity to" or "amount to" are set to 0.
-
#
amountFrom -
?string - Gets a minimum price of products (from the selected categories) that needs to be in the cart to apply the discount.
-
#
amountTo -
?string - Gets a maximum price of products (from the selected categories) that can be in the cart to apply the discount.
-
#
snakeType -
string - Returns the type of condition in the snake case format: lowercase and connected by underline
-
#
slugType -
string - Returns the type of condition in the slug format: lowercase and connected by hyphen
-
#
id -
?int -
#
name -
?string -
#
data -
?array -
#
active -
bool
No members match the filter.
Admin view
AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.
Properties 22
Take no arguments.
-
#
getQuantityFrom() -
?int - Gets a minimum quantity of products (from the selected categories) that needs to be in the cart to apply the discount.
-
#
getQuantityTo() -
?int - Gets a maximum quantity of products (from the selected categories) that can be in the cart to apply the discount. Can be 0 to exclude any product (from the selected categories) from the cart.
-
#
isAllowed() -
bool - Checks if the condition set to allow a product category. If is allowed when not forbidden.
-
#
isForbidden() -
bool - Checks if the condition set to forbid a product category. It is forbidden when either "quantity to" or "amount to" are set to 0.
-
#
getAmountFrom() -
?string - Gets a minimum price of products (from the selected categories) that needs to be in the cart to apply the discount.
-
#
getAmountTo() -
?string - Gets a maximum price of products (from the selected categories) that can be in the cart to apply the discount.
-
#
getSnakeType() -
string - Returns the type of condition in the snake case format: lowercase and connected by underline
-
#
getSlugType() -
string - Returns the type of condition in the slug format: lowercase and connected by hyphen
-
#
getId() -
?int -
#
getName() -
?string -
#
getData() -
?array -
#
isActive() -
bool -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
No members match the filter.