From fd101c391df768405455fca80b8b7cde665771e9 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Fri, 13 Aug 2021 05:19:45 +0000 Subject: [PATCH] Bug fix for when customer has customer promo tag but no hub. #614 --- src/Controller/APIController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index 15a63519..6d286ead 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -2600,6 +2600,17 @@ class APIController extends Controller implements LoggedController $hub = $car_club_cust_hub->getHub(); $nearest_hub_slots = $this->findAdvanceNearestHubAndSlots($coordinates, $em, $map_tools, $hub); } + else + { + $nearest_hub_slots = $this->findAdvanceNearestHubAndSlots($coordinates, $em, $map_tools); + + if (empty($nearest_hub_slots['hub'])) + { + $res->setError(true) + ->setErrorMessage('Thank you for reaching out to us. Due to the General Community Quarantine, our Operations are from 8AM to 6PM only. Please expect a call from us tomorrow and we will assist you with your request. Thank you and stay safe!'); + return $res->getReturnResponse(); + } + } } else {