couponable
Advanced tools
Comparing version 6.1.0 to 6.2.0
@@ -36,2 +36,3 @@ // if the comma or decimal portions of the price need internationalization | ||
total = orderItem.priceInCents; | ||
let totalAmountOffInCents; | ||
@@ -45,5 +46,10 @@ if (orderItem.variation) { | ||
total = total * quantity; | ||
if (orderItem.isBulkPurchase && orderItem.coupon.amountOffInCents) { | ||
totalAmountOffInCents = orderItem.coupon.amountOffInCents * quantity | ||
} | ||
quantity = 1; | ||
} | ||
total = Math.round(discountable(total, orderItem.coupon.percentOff, orderItem.coupon.amountOffInCents)); | ||
total = Math.round(discountable(total, orderItem.coupon.percentOff, totalAmountOffInCents || orderItem.coupon.amountOffInCents)); | ||
} | ||
@@ -50,0 +56,0 @@ |
{ | ||
"name": "couponable", | ||
"description": "Helper functions for dealing with coupons.", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"author": "Chris McC", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -48,3 +48,3 @@ var couponable = require('.'); | ||
isBulkPurchase: true | ||
}), 95); | ||
}), 50); | ||
}); | ||
@@ -51,0 +51,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13202
5
373