Skip to content
Permalink
Browse files

Fix restaurant closed when future order is enabled

  • Loading branch information...
sampoyigi committed Aug 1, 2019
1 parent 04d9884 commit 31b7e44e084dff4bdbff4e957c37d296da853505
Showing with 4 additions and 3 deletions.
  1. +1 −1 components/CartBox.php
  2. +1 −1 components/Checkout.php
  3. +2 −1 components/cartbox/buttons.php
@@ -158,7 +158,7 @@ public function onUpdateCart()
if (!$location = Location::current())
throw new ApplicationException(lang('igniter.cart::default.alert_location_required'));
if (Location::isClosed())
if (!$location->hasFutureOrder() AND Location::isClosed())
throw new ApplicationException(lang('igniter.cart::default.alert_location_closed'));
if (!Location::checkOrderType($orderType = Location::orderType()))
@@ -224,7 +224,7 @@ protected function validateCart($throwException = TRUE)
if (!$location = Location::current())
throw new ApplicationException(lang('igniter.cart::default.alert_location_required'));
if (Location::isClosed())
if (!$location->hasFutureOrder() AND Location::isClosed())
throw new ApplicationException(lang('igniter.cart::default.alert_location_closed'));
if (!Location::checkOrderType($orderType = Location::orderType()))
@@ -2,7 +2,8 @@
$fullyClosed = FALSE;
$cartTotalIsAboveMinTotal = $location->checkMinimumOrder($cart->subtotal());
$unAvailable = (!$location->checkOrderType() OR ($location->orderTypeIsDelivery() AND !$cartTotalIsAboveMinTotal));
if ($location->workingSchedule($location->orderType())->isClosed()) {
$workingSchedule = $location->workingSchedule($location->orderType());
if ($workingSchedule->isClosed() AND !$location->current()->hasFutureOrder()) {
$buttonLang = 'igniter.cart::default.text_is_closed';
$fullyClosed = TRUE;
}

0 comments on commit 31b7e44

Please sign in to comment.
You can’t perform that action at this time.