From 241233315225458ba4e0cc8b9e1a32e1e7a08a5b Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 7 Aug 2024 16:53:06 -0500 Subject: [PATCH] added conditional to listener --- app/Listeners/CheckoutableListener.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 63e552233c..5968632fdc 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -137,7 +137,11 @@ class CheckoutableListener */ private function getCheckoutAcceptance($event) { - if (! $event->checkoutable->requireAcceptance()) { + $checkedOutToType = get_class($event->checkedOutTo); + if ($checkedOutToType != "App\Models\User") { + return null; + } + if (!$event->checkoutable->requireAcceptance()) { return null; }