Menu_Section implements Component

Handles the display of a menu section. This is one grouping of products with an optional title and description.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

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

$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

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>
Tags
Return values
mixed

Search results