Skip to content

Commit

Permalink
fix: conditional query on cart's coupon_code
Browse files Browse the repository at this point in the history
  • Loading branch information
se09deluca committed Dec 31, 2023
1 parent 7f41cf6 commit 3c31a38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/Managers/DiscountManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function ($query, $value) {
}
)->when(
$cart?->coupon_code,
fn ($query, $value) => $query->where('coupon', '=', $value)->orWhere(fn ($query) => $query->whereNull('coupon')->orWhere('coupon', '')),
fn ($query, $value) => $query->where('coupon', '=', $value),
fn ($query, $value) => $query->whereNull('coupon')->orWhere('coupon', '')
)->orderBy('priority', 'desc')
->orderBy('id')
Expand Down

0 comments on commit 3c31a38

Please sign in to comment.