diff --git a/lib/Listener/MenuBoardProviderListener.php b/lib/Listener/MenuBoardProviderListener.php index d94ea8aeb6..9d9fcc6d45 100644 --- a/lib/Listener/MenuBoardProviderListener.php +++ b/lib/Listener/MenuBoardProviderListener.php @@ -60,7 +60,17 @@ public function onProductRequest(MenuBoardProductRequest $event): void return; } - $products = $this->menuBoardCategoryFactory->getProductData(null, ['menuId' => $menuId]); + // Build a filter + $filter = [ + 'menuId' => $menuId, + ]; + + // Show Unavailable? + if ($dataProvider->getProperty('showUnavailable', 0) === 0) { + $filter['availability'] = 0; + } + + $products = $this->menuBoardCategoryFactory->getProductData(['name'], $filter); foreach ($products as $menuBoardProduct) { $product = $menuBoardProduct->toProduct(); diff --git a/modules/menuboard-category.xml b/modules/menuboard-category.xml index c404556476..780320c46f 100644 --- a/modules/menuboard-category.xml +++ b/modules/menuboard-category.xml @@ -37,10 +37,21 @@ Menu Please select the Menu to use as a source of data for this template. + + + + + + Category Please select the Category to use as a source of data for this template. + + + + + diff --git a/modules/menuboard-product.xml b/modules/menuboard-product.xml index 72ba0bdd8d..740d55fa45 100644 --- a/modules/menuboard-product.xml +++ b/modules/menuboard-product.xml @@ -24,7 +24,7 @@ Core Display products from a Menu Board \Xibo\Widget\MenuBoardProductProvider - %menuId% + %menuId%_%showUnavailable% menuboard-product product 1 @@ -38,6 +38,30 @@ Menu Please select the Menu to use as a source of data for this template. + + Category + Filter by Category + + + + + + + + Show Unavailable Products? + Should the currently unavailable products appear in the menu? + 0 + + + Duration is per item + The duration specified is per item otherwise it is per menu. + 0 + + + + + + - \ No newline at end of file +