Percentage
How the percentage discount action works, what are the required and optional parameters to set it up, and the resources for which it's enabled
Actions of type percentage
enable you to apply a percentage discount to the amount of a specific field.
When setting up a percentage discount action, in addition to the action type
, you need to specify at least the attribute or resource on which to apply the action as the selector
key value and fill the value
key with the float number corresponding to the percentage discount to be applied (for more information on the parameters listed in the table below and how they work please refer to the main actions page):
type
Must be "percentage"
.
selector
identifier
Can be set only if the selector
key value is an attribute.
groups
bundle
aggregation
apply_on
limit
value
Example
The following action applies a 20% discount to the amount of all the line items associated with an SKU among the ones grouped as discountable-items
within the related condition matchers:
Value
The percentage to be discounted is defined by the value
key which must be provided in decimal form as a float number between 0
and 1
.
Maximum 4 decimals are allowed (e.g. 0.1535
corresponds to a 15.35% discount).
Restrictions
Percentage discount actions support bundles, provided that one or more groups among the ones defined when grouping the matches of the related conditions are specified.
You can set a limit on percentage discount actions only if you're not using bundles.
Resources
As regards the Rule Engine integration with Commerce Layer Core API, the percentage discount action type is available both for promotions (order rules) and price lists (price rules).
Last updated