Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sampoyigi committed Oct 18, 2023
1 parent 221db3e commit 8f7199c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cartconditions/Coupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ protected function validateCoupon($couponModel)
throw new ApplicationException(lang('igniter.cart::default.alert_coupon_maximum_reached'));

if (($couponModel->customer_redemptions
|| optional($this->customers)->isNotEmpty()
|| optional($this->customer_groups)->isNotEmpty()) && !$user
|| optional($couponModel->customers)->isNotEmpty()
|| optional($couponModel->customer_groups)->isNotEmpty()) && !$user
) throw new ApplicationException(lang('igniter.coupons::default.alert_coupon_login_required'));

if ($user && $couponModel->customerHasMaxRedemption($user))
Expand All @@ -176,7 +176,7 @@ protected function validateCoupon($couponModel)
throw_unless($couponModel->customerCanRedeem($user),
new ApplicationException(lang('igniter.coupons::default.alert_customer_cannot_redeem')));

throw_unless($couponModel->customerGroupCanRedeem($user->group),
throw_unless($couponModel->customerGroupCanRedeem(optional($user)->group),
new ApplicationException(lang('igniter.coupons::default.alert_customer_group_cannot_redeem')));
}

Expand Down

0 comments on commit 8f7199c

Please sign in to comment.