Coupons
Error
Stack frames (12)
11
Error
/
home
/deploy
/EHungry-2-joel
/Web
/accountsettings
/coupons.php
393
10
AccountSettings
\CouponRoutes
couponItem
/
home
/deploy
/EHungry-2-joel
/Web
/templates4.0
/customer
/coupons_block.php
22
9
{closure}
/
home
/deploy
/EHungry-2-joel
/Web
/eds
/utils.php
71
8
EDS
\{closure}
[internal]
0
7
array_map
/
home
/deploy
/EHungry-2-joel
/Web
/eds
/utils.php
72
6
EDS
\stringify_children
/
home
/deploy
/EHungry-2-joel
/Web
/eds
/components
/collection.php
57
5
EDS
\Collection
/
home
/deploy
/EHungry-2-joel
/Web
/templates4.0
/customer
/coupons_block.php
29
4
include
/
home
/deploy
/EHungry-2-joel
/Web
/templates4.0
/customer
/coupons.php
5
3
include
/
home
/deploy
/EHungry-2-joel
/Web
/view4.0
/customer
/category.php
5
2
include
/
home
/deploy
/EHungry-2-joel
/Web
/view4.0
/customer
/ordering3.php
19
1
include_once
/
home
/deploy
/EHungry-2-joel
/Web
/controllers
/customer.php
877
0
require
/
home
/deploy
/EHungry-2-joel
/Web
/index.php
30
/
home
/deploy
/EHungry-2-joel
/Web
/accountsettings
/coupons.php
<div class="d-flex flex-wrap gap-1 text-nowrap">
<? foreach ($labels as $label) { ?>
<?=\EDS\Label(['variant' => 'default', 'fill' => false], $label)?>
<? } ?>
</div>
</div>
<? } ?>
<div class="eds-copy-text-s-regular"><?=static::disclaimer($restaurant)?></div>
</div>
</template>
<?
$applied = $cart->getCoupon() && $cart->getCoupon()->id === $coupon->id;
$GLOBALS['restaurant'] = $restaurant; // NOTE: Needed for `couponErrors`
$errors = $applied ? $cart->couponErrors() : null;
$body = ob_get_clean();
return \EDS\Coupon(
array_merge([
'id' => "coupon-{$coupon->id}",
'class' => 'h-100',
'variant' => $errors ? 'warning' : ($applied ? 'success' : null),
'header' => [
$coupon->short_display_name ?: $coupon->display_name,
\EDS\Button([
'class' => 'float-end',
'variant' => 'outline-secondary',
'data-async-on-click' => true,
'data-async-before' => "$('[data-custom-popover]').popover('hide')",
'data-async-method' => 'post',
'data-async-action' => getUrl($applied
? '/account-settings/coupons/' . urlencode($coupon->id) . '/remove'
: '/account-settings/coupons/' . urlencode($coupon->id) . '/apply'),
'data-async-target' => '#coupons',
// Reloading the cart on pages where it doesn't exist causes the cart object to be recreated, leading to obscure bugs
'data-async-then' => in_array($_REQUEST['form'], ['home', 'mycoupons']) ? 'initPopovers()' : 'reloadCart({ data: { coupons: true } })',
'data-async-swap' => 'none',
'data-async-recaptcha' => !$customer,
Arguments
"Call to undefined function EDS\Coupon()"
/
home
/deploy
/EHungry-2-joel
/Web
/templates4.0
/customer
/coupons_block.php
?>
<?=\EDS\Collection(
[
'title' => $_REQUEST['form'] === 'mycoupons'
? '<h1 class="eds-display-text-title-l mb-0">Coupon Box</h1><p class="mb-0">If there are any public coupons or specials for which you are eligible, they are shown in your coupon box.</p>'
: '<h3 class="eds-display-text-title-m mb-0">Coupons</h3>',
'gradient_color' => 'var(--bs-light)',
'scroll_step' => "$(this).find('.coupon-item').width() + 12",
'show_controls' => count($coupons) > 1,
'breakout' => '0.75rem',
],
function () use ($cart, $coupons, $customer, $restaurant) {
ob_start();
?>
<div class="d-flex gap-2p5">
<? foreach ($coupons as $coupon) { ?>
<div class="coupon-item" style="width: 80vw; max-width: 20rem">
<?=AccountSettings\CouponRoutes::couponItem([], $coupon, $cart, $customer, $restaurant)?>
</div>
<? } ?>
</div>
<?
return ob_get_clean();
}
)?>
<?=AccountSettings\CouponRoutes::couponPopoverTemplate()?>
Arguments
[]
Coupon {}Cart {}nullRestaurant {}
/
home
/deploy
/EHungry-2-joel
/Web
/eds
/utils.php
return trim(join(' ', array_map(function ($child) {
return is_callable($child) && !is_string($child) ? $child() : $child;
}, is_array($children) ? $children : [$children])));
}
function to_event_objects($events) {
$event_objects = [];
foreach ($events as $declaration => $handler) {
$parts = explode(':', $declaration);
$name = reset($parts);
$modifiers = array_slice($parts, 1); // Inspired by https://vuejs.org/guide/essentials/event-handling
// Handlers
$handler_lines = array_filter([
'event.stopPropagation()' => in_array('stop', $modifiers),
'event.preventDefault()' => in_array('prevent', $modifiers),
$handler,
]);
// Options
$options = array_filter([
'once' => in_array('once', $modifiers),
'passive' => in_array('passive', $modifiers),
]);
$event_objects[] = [
'name' => $name,
'handler' => join(
count($handler_lines) > 1 ? "\n" : ' ',
['function () {', join('; ', $handler_lines), '}']
),
'options' => $options,
];
}
return $event_objects;
}
function html($tag_name, $attrs = [], $children = []) {
$stringified_attrs = stringify_attrs($attrs);
$stringified_children = stringify_children($children);
[internal]
Arguments
Closure { : { : Cart { …} : array:3 [ 0 => Coupon {} 1 => Coupon {} 2 => Coupon {} ] : null : Restaurant { …} } }
/
home
/deploy
/EHungry-2-joel
/Web
/eds
/utils.php
return is_callable($child) && !is_string($child) ? $child() : $child;
}, is_array($children) ? $children : [$children])));
}
function to_event_objects($events) {
$event_objects = [];
foreach ($events as $declaration => $handler) {
$parts = explode(':', $declaration);
$name = reset($parts);
$modifiers = array_slice($parts, 1); // Inspired by https://vuejs.org/guide/essentials/event-handling
// Handlers
$handler_lines = array_filter([
'event.stopPropagation()' => in_array('stop', $modifiers),
'event.preventDefault()' => in_array('prevent', $modifiers),
$handler,
]);
// Options
$options = array_filter([
'once' => in_array('once', $modifiers),
'passive' => in_array('passive', $modifiers),
]);
$event_objects[] = [
'name' => $name,
'handler' => join(
count($handler_lines) > 1 ? "\n" : ' ',
['function () {', join('; ', $handler_lines), '}']
),
'options' => $options,
];
}
return $event_objects;
}
function html($tag_name, $attrs = [], $children = []) {
$stringified_attrs = stringify_attrs($attrs);
$stringified_children = stringify_children($children);
Arguments
Closure { : { : {} } }
array:1 [ 0 => Closure { : { : Cart { …} : array:3 [ 0 => Coupon {} 1 => Coupon {} 2 => Coupon {} ] : null : Restaurant { …} } } ]
/
home
/deploy
/EHungry-2-joel
/Web
/eds
/components
/collection.php
['style' => 'padding-top: 2px; padding-right: 2px', 'variant' => 'outline-secondary', 'size' => 'small', 'shape' => 'circle', 'onclick' => "app.event.emit('scroll_to_previous_$id')", 'aria-label' => 'Scroll left'],
\EDS\Icon(['icon' => 'chevron-left'])
)?>
<?=\EDS\Button(
['style' => 'padding-top: 2px; padding-left: 2px', 'variant' => 'outline-secondary', 'size' => 'small', 'shape' => 'circle', 'onclick' => "app.event.emit('scroll_to_next_$id')", 'aria-label' => 'Scroll right'],
\EDS\Icon(['icon' => 'chevron-right'])
)?>
<? } ?>
</div>
<div class="position-relative">
<div
class="css-scroll-hidden overflow-auto d-flex gap-3 py-2 <?=$props['padding']?>"
style="<?=$props['breakout'] != null ? "max-width: 100vw; padding: 0 {$props['breakout']}" : 'max-width: calc(100vw - 2rem)'?>; scroll-behavior: smooth"
data-event-on:scroll_to_previous_<?=$id?>="this.scrollLeft = (Math.ceil(this.scrollLeft / <?=$scroll_width?>) - 1) * <?=$scroll_width?>"
data-event-on:scroll_to_next_<?=$id?>="this.scrollLeft = (Math.floor(this.scrollLeft / <?=$scroll_width?>) + 1) * <?=$scroll_width?>"
data-event-on:document_ready="app.event.emit('scroll_<?=$id?>', this.scrollLeft / (this.scrollWidth - this.clientWidth))"
onscroll="app.event.emit('scroll_<?=$id?>', this.scrollLeft / (this.scrollWidth - this.clientWidth))"
>
<?=\EDS\stringify_children($children)?>
</div>
<div
class="eds_collection-fade position-absolute top-0 bottom-0 start-0 "
style="background: linear-gradient(to right, <?=$props['gradient_color']?>, transparent);"
data-event-on:scroll_<?=$id?>="(scrollRatio) => this.style.opacity = 10 * scrollRatio"
></div>
<div
class="eds_collection-fade position-absolute top-0 bottom-0 end-0"
style="background: linear-gradient(to left, <?=$props['gradient_color']?>, transparent);"
data-event-on:scroll_<?=$id?>="(scrollRatio) => this.style.opacity = 10 * (1 - scrollRatio)"
></div>
</div>
</div>
<?
return ob_get_clean();
}
Arguments
Closure { : { : Cart { …} : array:3 [ 0 => Coupon {} 1 => Coupon {} 2 => Coupon {} ] : null : Restaurant { …} } }
/
home
/deploy
/EHungry-2-joel
/Web
/templates4.0
/customer
/coupons_block.php
'gradient_color' => 'var(--bs-light)',
'scroll_step' => "$(this).find('.coupon-item').width() + 12",
'show_controls' => count($coupons) > 1,
'breakout' => '0.75rem',
],
function () use ($cart, $coupons, $customer, $restaurant) {
ob_start();
?>
<div class="d-flex gap-2p5">
<? foreach ($coupons as $coupon) { ?>
<div class="coupon-item" style="width: 80vw; max-width: 20rem">
<?=AccountSettings\CouponRoutes::couponItem([], $coupon, $cart, $customer, $restaurant)?>
</div>
<? } ?>
</div>
<?
return ob_get_clean();
}
)?>
<?=AccountSettings\CouponRoutes::couponPopoverTemplate()?>
Arguments
array:5 [ "title" => "<h3 class="eds-display-text-title-m mb-0">Coupons</h3>" "gradient_color" => "var(--bs-light)" "scroll_step" => "$(this).find('.coupon-item').width() + 12" "show_controls" => true "breakout" => "0.75rem" ]
Closure { : { : Cart { …} : array:3 [ 0 => Coupon {} 1 => Coupon {} 2 => Coupon {} ] : null : Restaurant { …} } }
/
home
/deploy
/EHungry-2-joel
/Web
/templates4.0
/customer
/coupons.php
<?php
//if coupon box not hidden
if ($_REQUEST['form'] == 'mycoupons' || (!is_object($_REQUEST['_TEMPLATE_SETTINGS']['hide_coupons_box']) || !$_REQUEST['_TEMPLATE_SETTINGS']['hide_coupons_box']->getValue())) {
if ($coupons || $_REQUEST['form'] == 'mycoupons') { ?>
<? include(CORE_PATH. 'templates4.0/customer/coupons_block.php'); ?>
<? }
}
Arguments
"/home/deploy/EHungry-2-joel/Web/templates4.0/customer/coupons_block.php"
/
home
/deploy
/EHungry-2-joel
/Web
/view4.0
/customer
/category.php
<main class="main_content menucategory_page pb-5" id="main">
<div class="container">
<? if (count($coupons) > 0) { ?>
<section class="mb-3 pb-lg-3 mt-1 pt-3">
<? include(CORE_PATH. 'templates4.0/customer/coupons.php'); ?>
</section>
<? } ?>
<div class="row menu_wrapper menu_category_wrapper <?=count($menus) > 1 ? '' : 'menu_wrapper--no-menu-tabs'?>">
<section class="col-xl-4 d-none d-xl-block">
<?
/*
//this code block is for [ch24116] when functionality ready to be added
<div class="category_box filter_category_box">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
<input type="text" id="cart-custom-tip" class="form-control input-cart-custom-tip" name="custom_tip" placeholder="Search the menu...">
</div>
<div class="filters">
<div class="filter-header collapsed" data-toggle="collapse" href="#filterContents" role="button" aria-expanded="false" aria-controls="filterContents">
<span><i class="fa fa-filter filter-icon"></i> Additional filters</span><i class="fal fa-plus filter-toggle fa-lg"></i>
</div>
<div class="filter-content collapse" id="filterContents">
<div class="list-group" role="tablist">
<a class="list-group-item list-group-item-action" href="#" role="button"><input type="checkbox" class="css-checkbox" id="all" checked /> <label for="all" class="css-label">All</label></a>
<a class="list-group-item list-group-item-action" href="#" role="button"><input type="checkbox" class="css-checkbox" id="new" checked /> <label for="new" class="css-label">New</label><span class="nos"><img src="/web/default4.0/images/icons/item-icon-new.svg" alt="New" checked /></span></a>
<a class="list-group-item list-group-item-action" href="#" role="button"><input type="checkbox" class="css-checkbox" id="favorite" checked /> <label for="favorite" class="css-label">Favorite</label><span class="nos"><img src="/web/default4.0/images/icons/item-icon-favorite.svg" alt="Favorite" checked /></span></a>
<a class="list-group-item list-group-item-action" href="#" role="button"><input type="checkbox" class="css-checkbox" id="vegatarian" checked /> <label for="vegetarian" class="css-label">Vegetarian</label><span class="nos"><img src="/web/default4.0/images/icons/item-icon-vegetarian.svg" alt="Vegetarian" checked /></span></a>
<a class="list-group-item list-group-item-action" href="#" role="button"><input type="checkbox" class="css-checkbox" id="spicy" checked /> <label for="spicy" class="css-label">Spicy</label><span class="nos"><img src="/web/default4.0/images/icons/item-icon-hot.svg" alt="Spicy" checked /></span></a>
<a class="list-group-item list-group-item-action" href="#" role="button"><input type="checkbox" class="css-checkbox" id="healthy" checked /> <label for="healthy" class="css-label">Healthy</label><span class="nos"><img src="/web/default4.0/images/icons/item-icon-healthy.svg" alt="Healthy" checked /></span></a>
<a class="list-group-item list-group-item-action" href="#" role="button"><input type="checkbox" class="css-checkbox" id="glutenfree" checked /> <label for="glutenfree" class="css-label">Gluten-free</label><span class="nos"><img src="/web/default4.0/images/icons/item-icon-glutenFree.svg" alt="Gluten-Free" checked /></span></a>
<a class="list-group-item list-group-item-action" href="#" role="button"><input type="checkbox" class="css-checkbox" id="raw" checked /> <label for="raw" class="css-label">Raw</label><span class="nos"><img src="/web/default4.0/images/icons/item-icon-raw.svg" alt="Raw" checked /></span></a>
</div>
</div>
</div>
<div class="collapse" id="collapseExample">
<div class="card card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
</div>
</div>
Arguments
"/home/deploy/EHungry-2-joel/Web/templates4.0/customer/coupons.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/category.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']) && $_REQUEST['_VERSION'] != 4) {
$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"
Environment & details:
| Key | Value |
| aid | "restaurant/wingsingfishkill/order/main/chefs-special-cantonese-dishes/s-1-seafood-delight"
|
empty
empty
| Key | Value |
| PHPSESSID | "dhbp2377e1dbv900rm0ciubmhf"
|
| Key | Value |
| loc | "en_US"
|
| customer_account_id | 9131
|
| cart | Cart {}
|
| restaurant_id | 8263
|
| redirect_form | "checkout"
|
| app_banner_shown | true
|
| menu_id | 10517
|
| Key | Value |
| UNIQUE_ID | "abRYBJIt357iYsEaNmNKGQAAAAM"
|
| SCRIPT_URL | "/restaurant/wingsingfishkill/order/main/chefs-special-cantonese-dishes/s-1-seafood-delight"
|
| SCRIPT_URI | "http://www.springroll.com.2.joel.ehungry.net/restaurant/wingsingfishkill/order/main/chefs-special-cantonese-dishes/s-1-seafood-delight"
|
| HTTP_HOST | "www.springroll.com.2.joel.ehungry.net"
|
| HTTP_X_REAL_IP | "216.73.216.213"
|
| HTTP_X_CONFKEY | "Main_Domain:14844"
|
| HTTP_SCHEME | "https"
|
| HTTP_EHENV | "TODO"
|
| HTTP_CONNECTION | "close"
|
| HTTP_ACCEPT | "*/*"
|
| HTTP_USER_AGENT | "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
|
| HTTP_ACCEPT_ENCODING | "gzip, br, zstd, deflate"
|
| HTTP_COOKIE | "PHPSESSID=dhbp2377e1dbv900rm0ciubmhf"
|
| PATH | "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
|
| SERVER_SIGNATURE | "" |
| SERVER_SOFTWARE | "Apache/2.4.62 () mod_wsgi/4.6.5 Python/3.7 PHP/7.2.34"
|
| SERVER_NAME | "www.springroll.com.2.joel.ehungry.net"
|
| SERVER_ADDR | "127.0.0.1"
|
| SERVER_PORT | "80"
|
| REMOTE_ADDR | "216.73.216.213"
|
| DOCUMENT_ROOT | "/home/deploy/EHungry-2-joel/Web"
|
| REQUEST_SCHEME | "http"
|
| CONTEXT_PREFIX | "" |
| CONTEXT_DOCUMENT_ROOT | "/home/deploy/EHungry-2-joel/Web"
|
| SERVER_ADMIN | "root@localhost"
|
| SCRIPT_FILENAME | "/home/deploy/EHungry-2-joel/Web/index.php"
|
| REMOTE_PORT | "42536"
|
| GATEWAY_INTERFACE | "CGI/1.1"
|
| SERVER_PROTOCOL | "HTTP/1.0"
|
| REQUEST_METHOD | "GET"
|
| QUERY_STRING | "aid=restaurant/wingsingfishkill/order/main/chefs-special-cantonese-dishes/s-1-seafood-delight"
|
| REQUEST_URI | "/restaurant/wingsingfishkill/order/main/chefs-special-cantonese-dishes/s-1-seafood-delight"
|
| SCRIPT_NAME | "/restaurant/wingsingfishkill/order/main/chefs-special-cantonese-dishes/s-1-seafood-delight"
|
| PHP_SELF | "/restaurant/wingsingfishkill/order/main/chefs-special-cantonese-dishes/s-1-seafood-delight"
|
| REQUEST_TIME_FLOAT | 1773426692.228
|
| REQUEST_TIME | 1773426692
|
empty
0. Whoops\Handler\PrettyPageHandler