Display implements Standard_Service, JsonSerializable, Registerable

Responsible for returning the data needed to render the frontend.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Standard_Service
JsonSerializable
Registerable

Table of Contents

IDENTIFIER  = 'wcf-frontend'
The identifier for the frontend javascript.
$displayed_groups  : array<string|int, Group>
List of displayed groups.
add_displayed_group()  : Display
Add a group to the list of displayed groups.
enqueue_scripts()  : void
Register the frontend scripts.
get_admin_url()  : string
Get the admin URL.
get_button_text()  : string
Get the apply filters button text.
get_clear_button_text()  : string
Get the clear filters button text.
get_currency()  : array<string|int, mixed>
Get the currency data.
get_current_taxonomy()  : array<string|int, mixed>
Get the current taxonomy object.
get_default_catalog_sort()  : string
Get the default catalog sort option.
get_design_settings()  : array<string|int, mixed>
Get the design configuration of the plugin.
get_desktop_visibility()  : string
Get desktop visibility setting.
get_displayed_groups()  : array<string|int, Group>
Get the list of displayed groups.
get_filter_mode()  : string
Get the filter mode (instant/button).
get_horizontal_group_id()  : string
Get the horizontal group ID.
get_horizontal_per_row()  : int
Get the number of filters per row in horizontal layout.
get_mobile_visibility()  : string
Get mobile visibility setting.
get_orderby_options()  : array<string|int, mixed>
Get the catalog sorting options.
get_products_per_page()  : int
Returns the number of products per page.
get_rest_api_url()  : string
Get the REST API URL.
get_show_counters()  : bool
Check if counters should be displayed.
get_show_filters_button_text()  : string
Get the show filters button text.
get_slideout_heading()  : string
Get the slideout heading text.
get_string_between()  : string
Get a substring between two strings.
get_toggle_default_status()  : string
Get the default toggle status.
get_toggle_filters()  : bool
Check if filters should be toggleable.
indexing_notice()  : void
Display a notice to supervisors.
is_infinite_scrolling()  : bool
Check if infinite scrolling is enabled.
is_mobile()  : bool
Check if current request is from mobile device.
is_reindexing()  : bool
Check if reindexing is in progress.
is_supervisor()  : bool
Check if current user is a supervisor.
jsonSerialize()  : mixed
Use the JsonSerializable interface to add inline json on the frontend.
register()  : void
Register the hooks needed to render the frontend.
render_app_container_element()  : void
Render the app container element.
render_configuration()  : void
Render the configuration for the frontend.
render_horizontal_group()  : void
Render the horizontal group container.
render_pagination()  : void
Render the pagination container.
render_results()  : void
Render the results container.
render_wcf_elements()  : void
This is a general method to render the WCF elements.

Constants

IDENTIFIER

The identifier for the frontend javascript.

public string IDENTIFIER = 'wcf-frontend'

Properties

$displayed_groups

List of displayed groups.

public array<string|int, Group> $displayed_groups = []

Methods

add_displayed_group()

Add a group to the list of displayed groups.

public add_displayed_group(Group $group) : Display
Parameters
$group : Group
Return values
Display

enqueue_scripts()

Register the frontend scripts.

public enqueue_scripts() : void
Return values
void

get_admin_url()

Get the admin URL.

public get_admin_url() : string
Return values
string

get_button_text()

Get the apply filters button text.

public get_button_text() : string
Return values
string

get_clear_button_text()

Get the clear filters button text.

public get_clear_button_text() : string
Return values
string

get_currency()

Get the currency data.

public get_currency() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_current_taxonomy()

Get the current taxonomy object.

public get_current_taxonomy() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_default_catalog_sort()

Get the default catalog sort option.

public get_default_catalog_sort() : string
Return values
string

get_design_settings()

Get the design configuration of the plugin.

public static get_design_settings() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_desktop_visibility()

Get desktop visibility setting.

public get_desktop_visibility() : string
Return values
string

'open' for always visible, 'closed' for button reveal

get_displayed_groups()

Get the list of displayed groups.

public get_displayed_groups() : array<string|int, Group>
Return values
array<string|int, Group>

get_filter_mode()

Get the filter mode (instant/button).

public get_filter_mode() : string
Return values
string

get_horizontal_group_id()

Get the horizontal group ID.

public get_horizontal_group_id() : string
Return values
string

get_horizontal_per_row()

Get the number of filters per row in horizontal layout.

public get_horizontal_per_row() : int
Return values
int

get_mobile_visibility()

Get mobile visibility setting.

public get_mobile_visibility() : string
Return values
string

'open' for always visible, 'closed' for button reveal

get_orderby_options()

Get the catalog sorting options.

public get_orderby_options() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_products_per_page()

Returns the number of products per page.

public get_products_per_page() : int
Return values
int

get_rest_api_url()

Get the REST API URL.

public get_rest_api_url() : string
Return values
string

get_show_counters()

Check if counters should be displayed.

public get_show_counters() : bool
Return values
bool

get_show_filters_button_text()

Get the show filters button text.

public get_show_filters_button_text() : string
Return values
string

get_slideout_heading()

Get the slideout heading text.

public get_slideout_heading() : string
Return values
string

get_string_between()

Get a substring between two strings.

public static get_string_between(string $string, string $start, string $end) : string
Parameters
$string : string
$start : string
$end : string
Return values
string

get_toggle_default_status()

Get the default toggle status.

public get_toggle_default_status() : string
Return values
string

get_toggle_filters()

Check if filters should be toggleable.

public get_toggle_filters() : bool
Return values
bool

indexing_notice()

Display a notice to supervisors.

public indexing_notice() : void
Return values
void

is_infinite_scrolling()

Check if infinite scrolling is enabled.

public is_infinite_scrolling() : bool
Return values
bool

is_mobile()

Check if current request is from mobile device.

public is_mobile() : bool
Return values
bool

is_reindexing()

Check if reindexing is in progress.

public is_reindexing() : bool
Return values
bool

is_supervisor()

Check if current user is a supervisor.

public is_supervisor() : bool
Return values
bool

jsonSerialize()

Use the JsonSerializable interface to add inline json on the frontend.

public jsonSerialize() : mixed

This data is used globally by all filters throughout the site.

Return values
mixed

register()

Register the hooks needed to render the frontend.

public register() : void
Return values
void

render_app_container_element()

Render the app container element.

public render_app_container_element() : void
Return values
void

render_configuration()

Render the configuration for the frontend.

public render_configuration() : void
Return values
void

render_horizontal_group()

Render the horizontal group container.

public static render_horizontal_group() : void
Return values
void

render_pagination()

Render the pagination container.

public static render_pagination() : void
Return values
void

render_results()

Render the results container.

public static render_results() : void
Return values
void

render_wcf_elements()

This is a general method to render the WCF elements.

public static render_wcf_elements([bool $show_horizontal_group = true ][, bool $show_pagination = true ]) : void
Parameters
$show_horizontal_group : bool = true

Whether to show the horizontal group. Default true.

$show_pagination : bool = true

Whether to show the pagination. Default true.

Return values
void

Search results