Skip to content

Commit f19b6b7

Browse files
authored
Merge pull request #297 from rees46/feat/flags-for-product
feat: flags for product
2 parents 8868d43 + cc0deaf commit f19b6b7

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

source/includes/_loyalty.checkout.apply.md.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Content-type: application/json
2323
"current_time": "17:31",
2424
"cart_items": [
2525
{"product_id": "...", "price": 1000, "quantity": 4},
26-
{"product_id": "...", "price": 2000, "quantity": 1}
26+
{"product_id": "...", "price": 2000, "quantity": 1, "discountable": false, "bonusable": false, "rewardable": false }
2727
]
2828
}
2929
```

source/includes/_loyalty.checkout.estimate.md.erb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Content-type: application/json
2222
"current_time": "17:31",
2323
"cart_items": [
2424
{"product_id": "...", "price": 1000, "quantity": 4},
25-
{"product_id": "...", "price": 2000, "quantity": 1}
25+
{"product_id": "...", "price": 2000, "quantity": 1, "discountable": false, "bonusable": false, "rewardable": false }
2626
]
2727
}
2828
```
@@ -142,3 +142,13 @@ If `current_time` is missing or in incorrect format, current time in project's t
142142

143143
When clients proceed to the payment step, execute the next method `apply` to charge for bonuses and get the final payment value.
144144

145+
###
146+
147+
Optional parameters for every single product in the cart can disable some mechanics in the calculation process:
148+
149+
- `"bonusable": false` - forbid to use bonuses for the product;
150+
- `"discountable": false` - forbid to use discounts for the product;
151+
- `"rewardable": false` - forbid bonuses reward for the product.
152+
153+
Note: if imported product has a flag which deactivates reward, discounts or bonuses usage, setting a flag to `true` here will not overwrite restrictions from product feed.
154+
So the main use-case for these parameters: to disable reward, discounts and bonuses usage per product, but not to enable it.

0 commit comments

Comments
 (0)