Product_Archive
Customizer settings and controls for the Product Archive section.
This class defines constants and methods to register and manage customizer options for the product catalog, including settings for sorting, filtering, slugs, and layout.
- Full name:
\BigCommerce\Customizer\Sections\Product_Archive
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
NAME | public | string | ’bigcommerce_product_archive’ |
ARCHIVE_TITLE | public | string | ’bigcommerce_product_archive_title’ |
ARCHIVE_SLUG | public | string | ’bigcommerce_product_archive_slug’ |
ARCHIVE_DESCRIPTION | public | string | ’bigcommerce_product_archive_description’ |
SORT_OPTIONS | public | string | ’bigcommerce_product_archive_sort_options’ |
FILTER_OPTIONS | public | string | ’bigcommerce_product_archive_filter_options’ |
CATEGORY_SLUG | public | string | ’bigcommerce_category_archive_slug’ |
BRAND_SLUG | public | string | ’bigcommerce_brand_archive_slug’ |
SORT_FEATURED | public | string | ’featured’ |
SORT_DATE | public | string | ’date’ |
SORT_SALES | public | string | ’sales’ |
SORT_TITLE_ASC | public | string | ’title_asc’ |
SORT_TITLE_DESC | public | string | ’title_desc’ |
SORT_REVIEWS | public | string | ’reviews’ |
SORT_PRICE_ASC | public | string | ’price_asc’ |
SORT_PRICE_DESC | public | string | ’price_desc’ |
SORT_INVENTORY_COUNT | public | string | ’inventory_count’ |
SORT_SKU | public | string | ’sku’ |
FILTER_CATEGORY | public | string | \BigCommerce\Taxonomies\Product_Category\Product_Category::NAME |
FILTER_BRAND | public | string | \BigCommerce\Taxonomies\Brand\Brand::NAME |
PER_PAGE_DEFAULT | public | int | 24 |
PER_PAGE | public | string | ’bigcommerce_products_per_page’ |
GRID_COLUMNS | public | string | ’bigcommerce_catalog_grid_columns’ |
QUICK_VIEW | public | string | ’bigcommerce_enable_quick_view’ |
SEARCH_FIELD | public | string | ’bigcommerce_catalog_enable_search_field’ |
GENERAL_INVENTORY | public | string | ’bigcommerce_general_inventory_settings’ |
Methods
register
Registers customizer settings and controls for the product archive section.
public register(\WP_Customize_Manager $wp_customize): void
Parameters:
Parameter | Type | Description |
---|---|---|
$wp_customize | \WP_Customize_Manager | WordPress Customizer manager instance. |
sort_choices
Retrieves the available sorting choices for the product catalog.
public static sort_choices(): array
- This method is static.
Return Value:
An associative array of sorting choices with keys and labels.
sanitize_sort
Sanitizes and validates the sorting choices.
public sanitize_sort(array|string $values): array
Parameters:
Parameter | Type | Description |
---|---|---|
$values | array|string | The sorting choices input to sanitize. |
Return Value:
Sanitized sorting choices.
filter_choices
Retrieves filtering choices for the BigCommerce catalog.
public static filter_choices(): array
- This method is static.
Return Value:
The filtering options available.
sanitize_filter
Sanitizes the provided filter values to ensure they match available choices.
public sanitize_filter(array|string $values): array
Parameters:
Parameter | Type | Description |
---|---|---|
$values | array|string | The filter values to sanitize. |
Return Value:
The sanitized filter values.
get_field_description
Gets the field description for display in the WordPress Customizer.
public get_field_description(): string
Return Value:
The description HTML or an empty string.
Automatically generated on 2025-01-21