/home
/deploy
/EHungry-2-joel
/Web
/classes
/Restaurant.class.php
}
}
public function onSaving() {
self::clearCacheByAccountId($this->account_id);
return true;
}
/**
* Used in the customer side, to understand if there's any possibility of taking the user into the ordering pages -
* either to place an online order, or to get access to the PDF Menu.
* @return bool
* @noinspection PhpUnused
*/
public function getCantOrderNow(): bool {
return $this->has_no_ordering && !$this->pdf_menu_file;
}
public function getGroupFeesInsideTheCart(): bool {
return BillingOptions::hasBit($this->billing_options, BillingOptions::GROUP_FEES_INSIDE_THE_CART);
}
/**
* If Ordering is disabled ({@link has_no_ordering}), tells you what to say to the customer.
* @todo should this get integrated in isOrderingClosed()?
* @param string $start How it should start; gets followed by an apology and the CTA. Avoid using the default if <kbd>$showMenu=false</kbd>.
* @todo improve the default message so it doesn't seem weird when the PDF menu is available.
* @return string Empty if ordering is open :)
*/
public function generateHasNoOrderingMsg($start = 'Currently, we don\'t have our menu available online') {
if (!$this->has_no_ordering) {
return '';
}
$cta = $this->pdf_menu_file?
"You can <a href='{$this->getUrl('pdfMenuFile')}'>check our PDF Menu</a> in the meantime, or" :
"You may";
$cta .= " call us at <a href='tel:$this->primary_phone'>$this->primary_phone</a> if you have any questions.";
return "$start. We apologize for the inconvenience. $cta";
}
Arguments
"Class 'eHungry\classes\Bitmasks\BillingOptions' not found"
/home
/deploy
/EHungry-2-joel
/Web
/templates4.0
/customer
/cartordertotal.php
data-bs-toggle="popover"
data-bs-placement="bottom"
data-custom-popover=".coupon-restrictions-' . $coupon->id . '"
data-custom-template=".coupon-popover-template"
onclick="$(\'[data-custom-popover]\').popover(\'hide\')"
>View restrictions</a>'
)
.
\AccountSettings\CouponRoutes::couponRestrictionsPopoverContent($coupon, $cart->couponErrors())
.
\AccountSettings\CouponRoutes::couponPopoverTemplate()
: '';
if ($account->isCollectingSalesTax() && !($_REQUEST['form'] == 'checkout' || $_REQUEST['checkout'] == 'true')) {
echo $cart_error_messages.$cartCouponError;
$showingCartTotals = false;
return;
}
$showingCartTotals = true;
$groupTaxesAndFees = $restaurant->getGroupFeesInsideTheCart();
$taxesAndFeesClass = ($groupTaxesAndFees ? 'grouped-taxes-and-fees' : '');
$groupedTaxesAndFeesTotal = 0;
?>
<div class="order_total border-top bg-white p-3 pb-md-0">
<?=$cart_error_messages?>
<?=$cartCouponError?>
<? if ($account->show_coupon) {
if (!$coupon) { ?>
<div>
<a href="#" class="btn btn-outline-secondary btn-lg cart-btn w-100 hidden-lg-up mb10" id="btn-add-coupon-code" role="button" data-bs-target="#modal-coupon" data-open-coupon-modal>Add a coupon code</a>
</div>
<? }
} ?>
<table role="presentation">
<tbody>
<tr>
<th>Subtotal</th>
<td>
<?=$cart->getReadableSubtotal()?>
/home
/deploy
/EHungry-2-joel
/Web
/templates4.0
/customer
/cart.php
'variant' => 'outline-secondary',
'shape' => 'circle',
'onclick' => "app.event.emit('hide_cart')",
], EDS\Icon(['icon' => 'close', 'variant' => 'regular']))?>
<? } ?>
</div>
<div>
<? include(CORE_PATH. 'templates4.0/customer/change_location/cart.php'); ?>
<?
if ($closed_msg = isOrderingClosed(CLOSED_MSG_RESTAURANT)) {
$cart->clear();
?>
<div class="error p-3"><?=$closed_msg?></div>
</div>
<?
} else { ?>
<? include(CORE_PATH. 'templates4.0/customer/cartitems.php'); ?>
<? include(CORE_PATH. 'templates4.0/customer/cartordertotal.php'); ?>
</div>
<div class="fixed_submit pwa-pb-md-down">
<div class="p-3"><!-- Not using css calc() here because of lack of support in older devices -->
<?
/** @var bool $showingCartTotals */
if ($showingCartTotals && $account->show_coupon) {
if (!$coupon = $cart->getCoupon()) { ?>
<div>
<a href="#" class="btn btn-outline-secondary btn-lg cart-btn w-100 hidden-md-down" id="btn-add-coupon-code" role="button" data-bs-target="#modal-coupon" data-open-coupon-modal>Add a coupon code</a>
</div>
<? }
} ?>
<? if ($is_checkout_cart) { ?>
<? if ($cart->payment_method == PAYMENT_GOOGLE_PAY) { ?>
<div class="mt-lg-2">
<?=GooglePay::getButtonHtml($restaurant, $handler)?>
</div>
<? } else { ?>
Arguments
"/home/deploy/EHungry-2-joel/Web/templates4.0/customer/cartordertotal.php"
/home
/deploy
/EHungry-2-joel
/Web
/view4.0
/customer
/menu.php
<div class="promo_div">
<? }
if (isset($_REQUEST['_TEMPLATE_SETTINGS']['advertisement_text']) && $_REQUEST['_TEMPLATE_SETTINGS']['advertisement_text']->getValue() != "") { ?>
<span class="over"><?=$_REQUEST['_TEMPLATE_SETTINGS']['advertisement_text']->getValue()?></span>
<? } ?>
<img src="<?=$_REQUEST['_TEMPLATE_SETTINGS']['advertisement_image']->getUrl()?>" alt="<?= is_object($restaurant) ? $restaurant->display_name : 'Restaurant'?>" />
<? if (isset($_REQUEST['_TEMPLATE_SETTINGS']['advertisement_link']) && $_REQUEST['_TEMPLATE_SETTINGS']['advertisement_link']->getValue() != "") { ?>
</a>
<? } else { ?>
</div>
<? } ?>
</div>
</div>
<? } ?>
</div>
</div>
</form>
</main>
<? include(CORE_PATH. 'templates4.0/customer/cart.php'); ?>
Arguments
"/home/deploy/EHungry-2-joel/Web/templates4.0/customer/cart.php"
/home
/deploy
/EHungry-2-joel
/Web
/view4.0
/customer
/ordering3.php
<?
switch ($_REQUEST['ordering_level']) {
case OrderingLevel::NONE:
App::debugbarTime($timerLevel = 'ordering3: locationlist');
include(CORE_PATH . 'templates4.0/customer/locationlist.php');
break;
case OrderingLevel::RESTAURANT:
case OrderingLevel::MENU:
App::debugbarTime($timerLevel = 'ordering3: menu');
include(CORE_PATH . 'view4.0/customer/menu.php');
break;
case OrderingLevel::CATEGORY:
App::debugbarTime($timerLevel = 'ordering3: category');
include(CORE_PATH . 'view4.0/customer/category.php');
break;
case OrderingLevel::ITEM:
case OrderingLevel::PRICE:
App::debugbarTime($timerLevel = 'ordering3: menuitem');
include(CORE_PATH . 'view4.0/customer/category.php');
break;
}
if (isset($timerLevel)) {
App::debugbarTime($timerLevel);
}
Arguments
"/home/deploy/EHungry-2-joel/Web/view4.0/customer/menu.php"
/home
/deploy
/EHungry-2-joel
/Web
/controllers
/customer.php
if (!in_array($_REQUEST['form'], ['checkout', 'nosuchpage', 'validatecallback', 'viewdeliveryzone'])) {
//TODO: probably need to add one more form here that is called ajax, callback seems to reset when it shouldnt
unset($_SESSION['validation_data']);
}
$locs = $account->getActiveRestaurants('position');
$tab = MainNavigationTab::getAllForAccount($account->getId());
include_once(CORE_PATH.'lib/helpers/customer3.0.php');
if (!in_array($_REQUEST['form'], $viewContentOnly)) {
App::debugbarTime('header');
include_once(getLayoutPartPath('header'));
App::debugbarTime('header');
}
App::debugbarTime("view '{$_REQUEST['form']}'");
$path = CORE_PATH.'view' . ($_REQUEST['_VERSION'] == 4 ? 4 : 3) . '.0/customer/'.$_REQUEST['form'].'.php';
if (is_readable($path)) {
include_once($path);
}
App::debugbarTime("view '{$_REQUEST['form']}'");
if (!in_array($_REQUEST['form'], $viewContentOnly)) {
App::debugbarTime('footer');
include_once(getLayoutPartPath('footer'));
App::debugbarTime('footer');
}
function getLayoutPartPath($part) {
if (isset($_REQUEST['_CORDOVA_APP'])) {
$cart = Cart::getCurrent();
//FIXME: it's technically possible to end up with $template = null
if (!$_REQUEST['contentonly']) {
$template = !isset($_REQUEST["altdoc"])? "app/$part" : "app/alt$part";
}
} else {
$template = !isset($_REQUEST["altdoc"])? "customer/$part" : "customer/alt$part";
}
Arguments
"/home/deploy/EHungry-2-joel/Web/view4.0/customer/ordering3.php"
/home
/deploy
/EHungry-2-joel
/Web
/index.php
App::startTime();
ErrorHandlers::register();
// Global.php is the core setup file for the application
App::debugbarTime('Global.php');
require(dirname(__DIR__) . '/PHP/Global.php');
App::debugbarTime('Global.php');
/** @var string $controller The main controller - defined at /PHP/Global.php */
App::debugbarTime('Sentry - controller');
ErrorHandlers::sentryInit($controller); //doesn't always do much - not every controller has a Sentry project
App::debugbarTime('Sentry - controller');
App::debugbarTime("controller: $controller");
apache_note('AppController', $controller);
if (file_exists(CORE_PATH."lib/helpers/$controller.php")) {
require CORE_PATH."lib/helpers/$controller.php";
}
require CORE_PATH."controllers/$controller.php";
App::debugbarTime("controller: $controller");
Arguments
"/home/deploy/EHungry-2-joel/Web/controllers/customer.php"