Skip to content

Commit

Permalink
fix: Coupon subtotal condition is not working #683
Browse files Browse the repository at this point in the history
  • Loading branch information
treoden committed Jan 11, 2025
1 parent c826646 commit 6e556bf
Showing 1 changed file with 9 additions and 7 deletions.
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 6e556bf

Please sign in to comment.