Frontend | Backend | Api

Discounts\Models\Api\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.

Property Description Returns
productCategoryIds Gets the product category IDs for this condition. array
quantityFrom Gets a minimum quantity of products (from the selected categories) that needs to be in the cart to apply the discount. int
quantityTo 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. int
allowed Checks if the condition set to allow a product category. If is allowed when not forbidden. bool
forbidden Checks if the condition set to forbid a product category. It is forbidden when either "quantity to" or "amount to" are set to 0. bool
amountFrom Gets a minimum price of products (from the selected categories) that needs to be in the cart to apply the discount. string
amountTo Gets a maximum price of products (from the selected categories) that can be in the cart to apply the discount. string
displayType Returns the nice name of a condition type string
type Returns the type of condition string
snakeType Returns the type of condition in the snake case format: lowercase and connected by underline string
slugType Returns the type of condition in the slug format: lowercase and connected by hyphen string
id int
name string
data array
active bool
created Date the record was created. DateTime
modified Last modification date for the record. DateTime
rule Rule