Skip to content

Commit aab0ef4

Browse files
committed
fix: prevent discount by domain + counpon auto applied with no coupon
1 parent a7829df commit aab0ef4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

functions/lib/helpers.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ const matchDiscountRule = (_discountRules, params = {}, skipApplyAt) => {
217217
// then try to match by domain
218218
if (params.domain) {
219219
const discountRule = filteredRules.find(rule => {
220-
return rule.domain === params.domain || params.domain === `${rule.domain}.skip-open`
220+
if (rule.domain === params.domain || params.domain === `${rule.domain}.skip-open`) {
221+
return !rule.discount_coupon && !rule.utm_campaign && !rule.customer_ids?.length
222+
}
223+
return false
221224
})
222225
if (discountRule) {
223226
return {

0 commit comments

Comments
 (0)