ClassesBigCommerceTemplatesProduct Gallery

Product_Gallery

Constants

ConstantVisibilityTypeValue
PRODUCTpublic’product’
IMAGE_IDSpublic’image_ids’
YOUTUBE_VIDEOSpublic’youtube_videos’
FALLBACKpublic’fallback_image’
SIZEpublic’image_size’
THUMBNAILpublic’thumbnail_size’
ZOOMpublic’zoom’
ZOOM_SIZEpublic’zoom_size’
CDN_IMAGESpublic’cdn_images’

Properties

template

protected $template

wrapper_tag

protected string $wrapper_tag

wrapper_classes

protected string[] $wrapper_classes

Methods

parse_options

protected parse_options(array $options): array

Parameters:

ParameterTypeDescription
$optionsarray

zoom_size

protected zoom_size(): mixed

get_data

Build the data that will be available to the template

public get_data(): array

get_fallback

protected get_fallback(): mixed

get_videos

protected get_videos(\BigCommerce\Post_Types\Product\Product $product): mixed

Parameters:

ParameterTypeDescription
$product\BigCommerce\Post_Types\Product\Product

get_wrapper_classes

Add a class with the image size we’re using

protected get_wrapper_classes(): string[]

enable_zoom

protected enable_zoom(): mixed

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
  • This method is abstract.

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
  • This method is abstract.

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_images_cdn_url

Get list of cdn url for each image

public get_images_cdn_url(array $images_ids = []): array

Parameters:

ParameterTypeDescription
$images_idsarray

get_headless_images

public get_headless_images(\BigCommerce\Post_Types\Product\Product $product): array|array[]

Parameters:

ParameterTypeDescription
$product\BigCommerce\Post_Types\Product\Product


Automatically generated on 2025-01-21