You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Coupon codes don't seem to be sandboxed in channels - a coupon code assigned to channel A will also apply to orders in channel B if the coupon code is the same.
To Reproduce
Create 2 channels, A & B
Switch the admin UI to channel A
Create a promotion, call it "flash-sale", action being $20 off.
Switch to channel B
Create a promo, call it "flash-sale" matching the first promo under channel A.
Note, both promotions in channels A and B have the same code.
As a client, switch to channel A (pass channel A token with GraphQL requests)
run the ApplyCoupon mutation, give it the code "flash-sale"
This will apply 2 discounts from both channels on the active order, which is not the expected behavior
Expected behavior
When applying a coupon to an active order given a channel, only that coupon should be applied.
Other coupon codes under different channels, even if the coupon code matches should not be applied.
Environment (please complete the following information):
@vendure/core version: 1.9.3
Nodejs version: v18.8.0
Database (mysql/postgres etc): v18.8.0
The text was updated successfully, but these errors were encountered:
I have tried to reproduce this but I cannot. Here's a video recording where I think I am following the steps you laid out, but only a single promotion gets applied to the order.
issue-2052-repro-attempt.mp4
I did find an error (which is being fixed), which arises because this DB call does not limit to the current channel, which can sometimes result in a valid promo code being rejected (because it fetched a promotion from another channel first).
However, I'm not able to reproduce the scenario of multiple promotions from different channels being applied at once from a non-default channel.
Relates to #2052. When multiple channels have promotions with the same
coupon code, this could cause validation to incorrectly fail
because the DB lookup was not limiting to the active channel.
Thank you for this.
I was just about to file a bug for the issue you found - that's been causing us headaches and it was difficult to reproduce which is why we never filed a bug for it. Thanks a lot for the fix!
Regarding this bug - I'm not sure I filed it a long time ago. I got my way around this by making sure the coupons are unique across channels (which is hard to maintain). Feel free to close this bug - if I come across it again and can replicate I'll reopen it. I do look forward to getting the cross channel issue fixed though.
Describe the bug
Coupon codes don't seem to be sandboxed in channels - a coupon code assigned to channel A will also apply to orders in channel B if the coupon code is the same.
To Reproduce
Expected behavior
When applying a coupon to an active order given a channel, only that coupon should be applied.
Other coupon codes under different channels, even if the coupon code matches should not be applied.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: