@@ -45,7 +45,9 @@ const matchFreebieRule = (rule, params = {}) => {
45
45
const coupon = params . discount_coupon
46
46
const utm = params . utm && params . utm . campaign
47
47
if ( rule . domain && rule . domain !== params . domain ) {
48
- return false
48
+ if ( params . domain !== `${ rule . domain } .skip-open` ) {
49
+ return false
50
+ }
49
51
}
50
52
if ( rule . freebie_coupon && rule . freebie_utm ) {
51
53
return coupon ?. toUpperCase ( ) === rule . freebie_coupon ?. toUpperCase ( ) || ( utm ?. toUpperCase ( ) === rule . freebie_utm ?. toUpperCase ( ) )
@@ -56,7 +58,7 @@ const matchFreebieRule = (rule, params = {}) => {
56
58
if ( rule . freebie_utm ) {
57
59
return ( utm ?. toUpperCase ( ) === rule . freebie_utm ?. toUpperCase ( ) )
58
60
}
59
- return ! rule . domain || rule . domain === params . domain
61
+ return true
60
62
}
61
63
62
64
const checkOpenPromotion = rule => {
@@ -72,7 +74,9 @@ const getValidDiscountRules = (discountRules, params, itemsForKit) => {
72
74
return false
73
75
}
74
76
if ( rule . domain && rule . domain !== params . domain ) {
75
- if ( checkOpenPromotion ( rule ) || params . domain ) {
77
+ if ( params . domain === `${ rule . domain } .skip-open` ) {
78
+ if ( checkOpenPromotion ( rule ) ) return false
79
+ } else {
76
80
return false
77
81
}
78
82
}
@@ -206,7 +210,7 @@ const matchDiscountRule = (_discountRules, params = {}, skipApplyAt) => {
206
210
// then try to match by domain
207
211
if ( params . domain ) {
208
212
const discountRule = filteredRules . find ( rule => {
209
- return rule . domain === params . domain
213
+ return rule . domain === params . domain || params . domain === ` ${ rule . domain } .skip-open`
210
214
} )
211
215
if ( discountRule ) {
212
216
return {
0 commit comments