You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/discounts/discounts_api.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,27 +38,27 @@ Use the expression values provided below when using data migrations or when pars
38
38
Discount rules define how the calculate the price reduction.
39
39
The following discount rule types are available in the `\Ibexa\Discounts\Value\DiscountRule` namespace:
40
40
41
-
| Rule type| Identifier| Description | Expression value |
42
-
|---|---|---|---|
43
-
|`FixedAmount`| <nobr>`fixed_amount`</nobr> | Deducts the specified amount, for example <nobr>10 EUR</nobr>, from the base price | <nobr>`discount_amount`</nobr> |
44
-
|`Percentage`| <nobr>`percentage`</nobr> | Deducts the specified percentage, for example -10%, from the base price | <nobr>`discount_percentage`</nobr> |
41
+
| Rule type<br>(identifier)| Description | Expression value |
42
+
|---|---|---|
43
+
|`FixedAmount`<br><nobr>(`fixed_amount`)</nobr> | Deducts the specified amount, for example <nobr>10 EUR</nobr>, from the base price | <nobr>`discount_amount`</nobr> |
44
+
|`Percentage`<br><nobr>(`percentage`)</nobr> | Deducts the specified percentage, for example -10%, from the base price | <nobr>`discount_percentage`</nobr> |
45
45
46
46
Only a single discount can be applied to a given product, and a discount can only have a single rule.
47
47
48
48
### Conditions
49
49
50
50
With conditions you can narrow down the scenarios in which the discount applies. The following conditions are available in the `\Ibexa\Discounts\Value\DiscountCondition` and `\Ibexa\DiscountsCodes\Value\DiscountCondition` namespaces:
| <nobr>`IsInCategory`</nobr>| Cart, Catalog | <nobr>`is_in_category`</nobr> | Checks if the product belongs to specified [product categories]([[= user_doc =]]/pim/work_with_product_categories) |`categories`|
55
-
| <nobr>`IsInCurrency`</nobr>| Cart, Catalog |<nobr>`is_in_currency`</nobr> | Checks if the product has price in the specified currency | <nobr>`currency_code`</nobr> |
56
-
| <nobr>`IsInRegions`</nobr>| Cart, Catalog | <nobr>`is_in_regions`</nobr> | Checks if the customer is making the purchase in one of the specified regions |`regions`|
57
-
| <nobr>`IsProductInArray`</nobr>| Cart, Catalog | <nobr>`is_product_in_array`</nobr> | Checks if the product belongs to the group of selected products |`product_codes`|
58
-
| <nobr>`IsUserInCustomerGroup`</nobr>| Cart, Catalog| <nobr>`is_user_in_customer_group`</nobr> | Check if the customer belongs to specified [customer groups](customer_groups.md)|`customer_groups`|
59
-
| <nobr>`IsProductInQuantityInCart`</nobr>| Cart | <nobr>`is_product_in_quantity_in_cart`</nobr> | Checks if the required minimum quantity of a given product is present in the cart |`quantity`|
60
-
| <nobr>`MinimumPurchaseAmount`</nobr>| Cart | <nobr>`minimum_purchase_amount`</nobr> | Checks if purchase amount in the cart exceeds the specified minimum |`minimum_purchase_amount`|
61
-
| <nobr>`IsValidDiscountCode`</nobr>| Cart | <nobr>`is_valid_discount_code`</nobr> | Checks if the correct discount code has been provided and how many times it was used by the customer |`discount_code`, `usage_count`|
52
+
| Condition<br>(identifier)| Applies to | Description | Expression values |
53
+
|---|---|---|---|
54
+
| <nobr>`IsInCategory`</nobr><br><nobr>(`is_in_category`)</nobr>| Cart, Catalog| Checks if the product belongs to specified [product categories]([[= user_doc =]]/pim/work_with_product_categories) |`categories`|
55
+
| <nobr>`IsInCurrency`</nobr><br><nobr>(`is_in_currency`)</nobr>| Cart, Catalog| Checks if the product has price in the specified currency | <nobr>`currency_code`</nobr> |
56
+
| <nobr>`IsInRegions`</nobr><br><nobr>(`is_in_regions`)</nobr>| Cart, Catalog| Checks if the customer is making the purchase in one of the specified regions |`regions`|
57
+
| <nobr>`IsProductInArray`</nobr><br><nobr>(`is_product_in_array`)</nobr>| Cart, Catalog| Checks if the product belongs to the group of selected products |`product_codes`|
58
+
| <nobr>`IsUserInCustomerGroup`</nobr><br><nobr>(`is_user_in_customer_group`)</nobr> |Cart, Catalog |Check if the customer belongs to specified [customer groups](customer_groups.md)|<nobr>`customer_groups`</nobr>|
59
+
| <nobr>`IsProductInQuantityInCart`</nobr><br><nobr>(`is_product_in_quantity_in_cart`)</nobr>| Cart| Checks if the required minimum quantity of a given product is present in the cart |`quantity`|
60
+
| <nobr>`MinimumPurchaseAmount`</nobr><br><nobr>(`minimum_purchase_amount`)</nobr> |Cart |Checks if purchase amount in the cart exceeds the specified minimum |<nobr>`minimum_purchase_amount`</nobr>|
61
+
| <nobr>`IsValidDiscountCode`</nobr><br><nobr>(`is_valid_discount_code`)</nobr> |Cart |Checks if the correct discount code has been provided and how many times it was used by the customer |`discount_code`, <br>`usage_count`|
62
62
63
63
When multiple conditions are specified, all of them must be met.
0 commit comments