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:
@@ -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