From 8f7199c2335810e3c1ea9ff68cacac677f7f9420 Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:45:14 +0100 Subject: [PATCH] Minor fix --- cartconditions/Coupon.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cartconditions/Coupon.php b/cartconditions/Coupon.php index 8d074c6..2eb2db3 100644 --- a/cartconditions/Coupon.php +++ b/cartconditions/Coupon.php @@ -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)) @@ -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'))); }