-
Notifications
You must be signed in to change notification settings - Fork 4
/
example.button.blade.php
executable file
·25 lines (24 loc) · 1.38 KB
/
example.button.blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!--
This is an example of how to show a menu item's out-of-stock locationable status. The fa-plus icon will be disabled when this menu item is out of stock.
Try using this file by replacing extensions/igniter/local/components/menu/button.blade.php with this file, or edit the component file through the admin UI.
-->
<button
class="btn btn-light btn-sm btn-cart{{ ($menuItemObject->mealtimeIsNotAvailable || $menuItemObject->model->isOutOfStock($location->getId(), $location->orderDateTime()) ) ? ' disabled' : '' }}"
@if (!$menuItemObject->mealtimeIsNotAvailable && !$menuItemObject->model->isOutOfStock($location->getId(), $location->orderDateTime()))
@if ($menuItemObject->hasOptions)
data-cart-control="load-item"
data-menu-id="{{ $menuItem->menu_id }}"
data-quantity="{{ $menuItem->minimum_qty }}"
@else
data-request="{{ $updateCartItemEventHandler }}"
data-request-data="menuId: '{{ $menuItem->menu_id }}', quantity: '{{ $menuItem->minimum_qty }}'"
data-replace-loading="fa fa-spinner fa-spin"
@endif
@elseif($menuItemObject->mealtimeIsNotAvailable)
title="{{ implode("\r\n", $menuItemObject->mealtimeTitles) }}"
@elseif($menuItemObject->model->isOutOfStock($location->getId(), $location->orderDateTime()))
title="Out of stock"
@endif
>
<i class="fa fa-{{ $menuItemObject->mealtimeIsNotAvailable ? 'clock-o' : 'plus' }}"></i>
</button>