Merge branch '637-set-up-24-7-ordering-using-app' into 'master-fix'

Resolve "Set up 24/7 ordering using app"

See merge request jankstudio/resq!750
This commit is contained in:
Kendrick Chan 2021-11-08 10:08:10 +00:00
commit 11c323f39a

View file

@ -3196,7 +3196,7 @@ class APIController extends Controller implements LoggedController
$schedule_choice = true;
// TODO: remove the time check after ECQ. This will then always return true
// remove the time check after ECQ. This will then always return true
// get current time
$current_datetime = new DateTime();
//$current_datetime = DateTime::createFromFormat('Y-m-d H:i', '2020-04-30 17:01');
@ -3204,8 +3204,10 @@ class APIController extends Controller implements LoggedController
// get the hour
$hour = $current_datetime->format('G');
if (($hour < 8) || ($hour > 16))
$schedule_choice = false;
// commenting out the time check since we can now book 24/7
// this will get uncommented out if and when ECQ will kick in
//if (($hour < 8) || ($hour > 16))
// $schedule_choice = false;
// add checking if customer has a pre-registered hub
$cust = $this->session->getCustomer();
@ -3227,6 +3229,9 @@ class APIController extends Controller implements LoggedController
}
}
// schedule_choice will always be true aka customer can opt to
// Book Now or Schedule Order EXCEPT if customer has customer tag promo
// or ECQ comes back
$data = [
'display_schedule_choice' => $schedule_choice,
];