Skip to content

Commit

Permalink
Merge pull request #684 from evershopcommerce/dev
Browse files Browse the repository at this point in the history
fix: Coupon subtotal condition is not working #683
  • Loading branch information
treoden authored Jan 11, 2025
2 parents 8aa4a85 + 6e556bf commit 702498a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Binary file modified changelog.md
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,16 @@ module.exports.registerDefaultValidators =
)
? parseFloat(conditions.order_total)
: null;
if (
minimumSubTotal && priceIncludingTax
? cart.getData('sub_total_incl_tax')
: cart.getData('sub_total') < minimumSubTotal
) {
return false;
if (minimumSubTotal === null) {
return true;
}
return true;
let check = false;
if (priceIncludingTax) {
check = cart.getData('sub_total_incl_tax') >= minimumSubTotal;
} else {
check = cart.getData('sub_total') >= minimumSubTotal;
}
return check;
},
function minimumQtyValidator(cart, coupon) {
const conditions = coupon.condition;
Expand Down

0 comments on commit 702498a

Please sign in to comment.