Layered_Nav extends WCWP_Widget
Wholesale Store Layered Nav Filter
Tags
Table of Contents
- __construct() : mixed
- Constructor.
- body_class() : array<string|int, mixed>
- Adds the 'woocommerce' <body> class if the widgets are visible and pick up correct styles in certain themes (Genesis, Total, etc).
- form() : mixed
- Outputs the settings update form.
- init_settings() : mixed
- Init settings after post types are registered.
- update() : array<string|int, mixed>
- Updates a particular instance of a widget.
- widget() : mixed
- Output widget.
- get_current_page_url() : string
- Get current page URL with various filtering props supported by WC.
- get_current_taxonomy() : string
- Return the currently viewed taxonomy name.
- get_current_term_id() : int
- Return the currently viewed term ID.
- get_current_term_slug() : int
- Return the currently viewed term slug.
- get_filtered_term_product_counts() : array<string|int, mixed>
- Count products within certain terms, taking the main WP query into consideration.
- get_instance_display_type() : string
- Get this widgets display type.
- get_instance_query_type() : string
- Get this widgets query type.
- get_instance_taxonomy() : string
- Get this widgets taxonomy.
- get_main_meta_query() : mixed
- Get the main meta query
- get_main_search_query_sql() : string
- Generates SQL clause for search string
- get_main_tax_query() : mixed
- Get the main taxonomy query
- has_product_table_on_page() : bool
- Determines whether a product table is on the page
- is_visible() : bool
- Determins whether the widget should display
- layered_nav_dropdown() : bool
- Show dropdown layered nav.
- layered_nav_list() : bool
- Show list based layered nav.
Methods
__construct()
Constructor.
public
__construct() : mixed
Tags
Return values
mixed —body_class()
Adds the 'woocommerce' <body> class if the widgets are visible and pick up correct styles in certain themes (Genesis, Total, etc).
public
body_class(array<string|int, mixed> $classes) : array<string|int, mixed>
Parameters
- $classes : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —$classes
form()
Outputs the settings update form.
public
form(array<string|int, mixed> $instance) : mixed
Parameters
- $instance : array<string|int, mixed>
-
Instance.
Tags
Return values
mixed —init_settings()
Init settings after post types are registered.
public
init_settings() : mixed
Tags
Return values
mixed —update()
Updates a particular instance of a widget.
public
update(array<string|int, mixed> $new_instance, array<string|int, mixed> $old_instance) : array<string|int, mixed>
Parameters
- $new_instance : array<string|int, mixed>
-
New Instance.
- $old_instance : array<string|int, mixed>
-
Old Instance.
Tags
Return values
array<string|int, mixed> —widget()
Output widget.
public
widget(array<string|int, mixed> $args, array<string|int, mixed> $instance) : mixed
Parameters
- $args : array<string|int, mixed>
-
Arguments.
- $instance : array<string|int, mixed>
-
Instance.
Tags
Return values
mixed —get_current_page_url()
Get current page URL with various filtering props supported by WC.
protected
get_current_page_url() : string
Tags
Return values
string —get_current_taxonomy()
Return the currently viewed taxonomy name.
protected
get_current_taxonomy() : string
Tags
Return values
string —get_current_term_id()
Return the currently viewed term ID.
protected
get_current_term_id() : int
Tags
Return values
int —get_current_term_slug()
Return the currently viewed term slug.
protected
get_current_term_slug() : int
Tags
Return values
int —get_filtered_term_product_counts()
Count products within certain terms, taking the main WP query into consideration.
protected
get_filtered_term_product_counts(array<string|int, mixed> $term_ids, string $taxonomy, string $query_type) : array<string|int, mixed>
This query allows counts to be generated based on the viewed products, not all products.
Parameters
- $term_ids : array<string|int, mixed>
-
Term IDs.
- $taxonomy : string
-
Taxonomy.
- $query_type : string
-
Query Type.
Tags
Return values
array<string|int, mixed> —get_instance_display_type()
Get this widgets display type.
protected
get_instance_display_type(array<string|int, mixed> $instance) : string
Parameters
- $instance : array<string|int, mixed>
-
Array of instance options.
Tags
Return values
string —get_instance_query_type()
Get this widgets query type.
protected
get_instance_query_type(array<string|int, mixed> $instance) : string
Parameters
- $instance : array<string|int, mixed>
-
Array of instance options.
Tags
Return values
string —get_instance_taxonomy()
Get this widgets taxonomy.
protected
get_instance_taxonomy(array<string|int, mixed> $instance) : string
Parameters
- $instance : array<string|int, mixed>
-
Array of instance options.
Tags
Return values
string —get_main_meta_query()
Get the main meta query
protected
static get_main_meta_query() : mixed
Tags
Return values
mixed —get_main_search_query_sql()
Generates SQL clause for search string
protected
static get_main_search_query_sql() : string
Tags
Return values
string —get_main_tax_query()
Get the main taxonomy query
protected
static get_main_tax_query() : mixed
Tags
Return values
mixed —has_product_table_on_page()
Determines whether a product table is on the page
protected
static has_product_table_on_page() : bool
Tags
Return values
bool —is_visible()
Determins whether the widget should display
protected
is_visible() : bool
Tags
Return values
bool —layered_nav_dropdown()
Show dropdown layered nav.
protected
layered_nav_dropdown(array<string|int, mixed> $terms, string $taxonomy, string $query_type) : bool
Parameters
- $terms : array<string|int, mixed>
-
Terms.
- $taxonomy : string
-
Taxonomy.
- $query_type : string
-
Query Type.
Tags
Return values
bool —Will nav display?
layered_nav_list()
Show list based layered nav.
protected
layered_nav_list(array<string|int, mixed> $terms, string $taxonomy, string $query_type) : bool
Parameters
- $terms : array<string|int, mixed>
-
Terms.
- $taxonomy : string
-
Taxonomy.
- $query_type : string
-
Query Type.
Tags
Return values
bool —Will nav display?