ClassesBigCommerceWidgetsProduct Category Widget

Product_Category_Widget

Class Product_Category_Widget

A widget to display a list or dropdown of product categories

  • Full name: \BigCommerce\Widgets\Product_Category_Widget
  • Parent class: WP_Widget

Constants

ConstantVisibilityTypeValue
NAMEpublic’bigcommerce_product_categories’

Methods

__construct

Sets up a new Product Categories widget instance.

public __construct(): mixed

widget

Outputs the content for the current Product Categories widget instance.

public widget(array $args, array $instance): mixed

Parameters:

ParameterTypeDescription
$argsarrayDisplay arguments including ‘before_title’, ‘after_title’,
‘before_widget’, and ‘after_widget’.
$instancearraySettings for the current Categories widget instance.

category_dropdown

protected category_dropdown(mixed $title, mixed $args, mixed $instance): mixed

Parameters:

ParameterTypeDescription
$titlemixed
$argsmixed
$instancemixed

protected dropdown_js(mixed $dropdown_id): mixed

Parameters:

ParameterTypeDescription
$dropdown_idmixed

category_list

protected category_list(mixed $args, mixed $instance): mixed

Parameters:

ParameterTypeDescription
$argsmixed
$instancemixed

update

Handles updating settings for the current Product Categories widget instance.

public update(array $new_instance, array $old_instance): array

Parameters:

ParameterTypeDescription
$new_instancearrayNew settings for this instance as input by the user via
WP_Widget::form().
$old_instancearrayOld settings for this instance.

Return Value:

Updated settings to save.


form

Outputs the settings form for the Product Categories widget.

public form(array $instance): mixed

Parameters:

ParameterTypeDescription
$instancearrayCurrent settings.


Automatically generated on 2025-01-21