Menu_Section implements Component
Handles the display of a menu section. This is one grouping of products with an optional title and description.
Tags
Interfaces, Classes and Traits
- Component
- Represents a restaurant menu component that can be rendered.
Table of Contents
- $data : Section_Data
- $options : Menu_Options
- $products : array<string|int, WC_Product>
- $template_loader : Template_Loader
- __construct() : mixed
- get_products() : mixed
- get_section() : mixed
- render() : string
- Renders the component. HTML is returned, not echoed.
- get_products_class() : mixed
- is_product_modal_enabled() : mixed
- parse_products() : mixed
Properties
$data
protected
Section_Data
$data
The menu section data.
Tags
$options
protected
Menu_Options
$options
The options for this section.
Tags
$products
protected
array<string|int, WC_Product>
$products
The list of products to display in this section.
Tags
$template_loader
private
Template_Loader
$template_loader
The template loader.
Tags
Methods
__construct()
public
__construct(Section_Data $data, Menu_Options $options) : mixed
Parameters
- $data : Section_Data
- $options : Menu_Options
Tags
Return values
mixed —get_products()
public
get_products() : mixed
Tags
Return values
mixed —get_section()
public
get_section() : mixed
Tags
Return values
mixed —render()
Renders the component. HTML is returned, not echoed.
public
render() : string
Tags
Return values
string —The component output.
get_products_class()
protected
get_products_class() : mixed
Tags
Return values
mixed —is_product_modal_enabled()
protected
is_product_modal_enabled() : mixed
Tags
Return values
mixed —parse_products()
private
parse_products(array<string|int, mixed> $products) : mixed
Parameters
- $products : array<string|int, mixed>