fix(promotion, types): non discountable items check (#12644)
* fix(promotions): check if item is discountable * fix: return earl yonly if non discountable * fix: update test * chore: add integration test
This commit is contained in:
1 parent
6be5750fe8
commit
bd6d9777c5
5 files changed
+175
-1
No files matched your search
@@ -201,7 +201,15 @@ function getValidItemsForPromotion(
|
||||
}
|
||||
|
||||
return items.filter((item) => {
|
||||
if (!item || !("subtotal" in item) || MathBN.lte(item.subtotal, 0)) {
|
||||
if (!item) {
|
||||
return false
|
||||
}
|
||||
|
||||
if ("is_discountable" in item && !item.is_discountable) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (!("subtotal" in item) || MathBN.lte(item.subtotal, 0)) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user