ClassesBigCommerceTemplatesOption_TypesOption Product List with Images

Option_Product_List_With_Images

Properties

template

protected $template

Methods

get_options

protected get_options(): mixed

get_attachment_id

protected get_attachment_id(mixed $post_id): mixed

Parameters:

ParameterTypeDescription
$post_idmixed

Inherited methods

format_currency

Formats a numeric value as a currency string.

protected format_currency(float $value, string $empty_value = ''): string

Parameters:

ParameterTypeDescription
$valuefloatThe currency value to format.
$empty_valuestringThe value to return if $value is empty. Pass null to format anyway.

Return Value:

The formatted currency string or the empty value.


factory

Creates an instance of the controller

public static factory(array $options = [], string $template = ''): static
  • This method is static.

Parameters:

ParameterTypeDescription
$optionsarray
$templatestring

__construct

public __construct(array $options = [], string $template = ''): mixed

Parameters:

ParameterTypeDescription
$optionsarray
$templatestring

parse_options

protected parse_options(array $options): array

Parameters:

ParameterTypeDescription
$optionsarray

render

Render the template and return it as a string

public render(): string

Return Value:

The rendered template


get_data

Build the data that will be available to the template

public get_data(): array

wrap

Wrap the template output in an optional tag. This provides us a mechanism to ensure that some elements and classes are consistently available for JavaScript targeting, despite possible template overrides.

protected wrap(string $html): string

Parameters:

ParameterTypeDescription
$htmlstring

get_wrapper_tag

protected get_wrapper_tag(): mixed

get_wrapper_classes

protected get_wrapper_classes(): mixed

get_wrapper_attributes

protected get_wrapper_attributes(): mixed

build_attribute_string

Build a string of HTML attributes that can safely be injected into a template out of a list of key/value pairs

protected build_attribute_string(array $attributes): string

Parameters:

ParameterTypeDescription
$attributesarray

get_id

protected get_id(): mixed

get_label

protected get_label(): mixed

get_options

protected get_options(): mixed

default_option

protected default_option(): mixed

sort_options

protected sort_options(mixed $a, mixed $b): mixed

Parameters:

ParameterTypeDescription
$amixed
$bmixed

get_matching_post_id

protected get_matching_post_id(int $bc_id): int

Parameters:

ParameterTypeDescription
$bc_idintThe BigCommerce product ID

Return Value:

The WordPress post ID for the product



Automatically generated on 2025-01-21