Data_Factory
Factory class to get the product table data object for a given column.
Tags
Table of Contents
- $args : Args
- The full list of table args.
- $available_variations : mixed
- __construct() : mixed
- The main class constructor
- get_attribute_image_html() : string
- Generate the HTML markup of an image
- get_attribute_term_image() : mixed
- get_available_variations() : mixed
- get_cell_content() : mixed
- get_cell_html() : mixed
- get_default_quantity() : int
- Retrieve the default quantity for each product
- get_extra_attribute_dropdown_html() : mixed
- get_filtered_available_variations() : mixed
- get_image_html() : mixed
- get_price_range_html() : mixed
- get_quantity_input_html() : mixed
- get_single_variation_input_attrs() : mixed
- get_stock_html() : mixed
- get_variation_image_id() : mixed
- convert_wc_input_attrs() : mixed
- The woocommerce_quantity_input_args filter has all sorts of custom names for attributes that get hardcoded into the template, this function massages those array keypairs into their final form.
Properties
$args
The full list of table args.
private
Args
$args
$available_variations
private
mixed
$available_variations
= []
Methods
__construct()
The main class constructor
public
__construct(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>
-
The array with all configuration options.
Return values
mixed —get_attribute_image_html()
Generate the HTML markup of an image
public
get_attribute_image_html(string $variation_attribute, mixed $aria_label) : string
Parameters
- $variation_attribute : string
-
The attribute to retrieve an image for
- $aria_label : mixed
Return values
string —The HTML markup of the retrieved image or empty string
get_attribute_term_image()
public
get_attribute_term_image(mixed $term_slug[, mixed $dimension = 'rows' ]) : mixed
Parameters
- $term_slug : mixed
- $dimension : mixed = 'rows'
Return values
mixed —get_available_variations()
public
get_available_variations() : mixed
Return values
mixed —get_cell_content()
public
get_cell_content(mixed $column, mixed $row) : mixed
Parameters
- $column : mixed
- $row : mixed
Return values
mixed —get_cell_html()
public
get_cell_html(mixed $column, mixed $row) : mixed
Parameters
- $column : mixed
- $row : mixed
Return values
mixed —get_default_quantity()
Retrieve the default quantity for each product
public
get_default_quantity(WC_Product $product) : int
Parameters
- $product : WC_Product
-
The product
Return values
int —The default quantity
get_extra_attribute_dropdown_html()
public
get_extra_attribute_dropdown_html() : mixed
Return values
mixed —get_filtered_available_variations()
public
get_filtered_available_variations(mixed $variation_ids) : mixed
Parameters
- $variation_ids : mixed
Return values
mixed —get_image_html()
public
get_image_html(mixed $image_id[, mixed $aria_label = '' ][, mixed $use_lightbox = true ], mixed $product_id) : mixed
Parameters
- $image_id : mixed
- $aria_label : mixed = ''
- $use_lightbox : mixed = true
- $product_id : mixed
Return values
mixed —get_price_range_html()
public
get_price_range_html(mixed $variation_ids) : mixed
Parameters
- $variation_ids : mixed
Return values
mixed —get_quantity_input_html()
public
get_quantity_input_html(mixed $variation_ids[, mixed $is_single_variation = false ]) : mixed
Parameters
- $variation_ids : mixed
- $is_single_variation : mixed = false
Return values
mixed —get_single_variation_input_attrs()
public
get_single_variation_input_attrs(mixed $variation_ids, mixed $is_single_variation) : mixed
Parameters
- $variation_ids : mixed
- $is_single_variation : mixed
Return values
mixed —get_stock_html()
public
get_stock_html(mixed $product) : mixed
Parameters
- $product : mixed
Return values
mixed —get_variation_image_id()
public
get_variation_image_id(mixed $attribute) : mixed
Parameters
- $attribute : mixed
Return values
mixed —convert_wc_input_attrs()
The woocommerce_quantity_input_args filter has all sorts of custom names for attributes that get hardcoded into the template, this function massages those array keypairs into their final form.
private
convert_wc_input_attrs(mixed $attrs) : mixed
Parameters
- $attrs : mixed