Args
Responsible for storing and validating the product variations arguments.
Parses an array of args into the corresponding properties.
Tags
Table of Contents
- $default_args : array<string|int, mixed>
- The default arguments for the class options.
- $args : mixed
- __construct() : mixed
- get_args() : mixed
- get_attribute_count() : mixed
- get_attribute_variation_ids() : mixed
- get_available_children() : mixed
- get_cell_variation_ids() : mixed
- get_defaults() : mixed
- get_product_attributes() : array<string|int, mixed>
- Prepare an associative array of attributes with the terms listed in the 'terms' property.
- get_term_thumbnails() : mixed
- is_variation_visible() : mixed
- process_data() : mixed
- set_args() : mixed
- set_settings() : mixed
- parse_args() : mixed
- recursive_merge() : mixed
Properties
$default_args
The default arguments for the class options.
public
static array<string|int, mixed>
$default_args
= ['include' => 0, 'columns' => '', 'rows' => '', 'enable' => false, 'enable_multivariation' => false, 'disable_purchasing' => false, 'show_stock' => false, 'show_description' => false, 'hide_same_price' => false, 'images' => false, 'variation_attribute' => '', 'sticky_header' => true, 'scroll_offset' => '15', 'delete_data' => false, 'image_direction' => '', 'variation_images' => 'off', 'add_images_to_gallery' => false, 'use_lightbox' => true, 'has_images' => false, 'attributes' => [], 'default_horizontal_attribute' => [], 'default_vertical_attribute' => [], 'grid_mode' => 'expanded', 'has_fast_pool' => false]
The default table parameters
$args
private
mixed
$args
= []
Methods
__construct()
public
__construct([array<string|int, mixed> $args = [] ]) : mixed
Parameters
- $args : array<string|int, mixed> = []
Return values
mixed —get_args()
public
get_args() : mixed
Return values
mixed —get_attribute_count()
public
get_attribute_count() : mixed
Return values
mixed —get_attribute_variation_ids()
public
get_attribute_variation_ids(mixed $attribute) : mixed
Parameters
- $attribute : mixed
Return values
mixed —get_available_children()
public
get_available_children(mixed $product) : mixed
Parameters
- $product : mixed
Return values
mixed —get_cell_variation_ids()
public
get_cell_variation_ids(mixed $column[, mixed $row = '' ]) : mixed
Parameters
- $column : mixed
- $row : mixed = ''
Return values
mixed —get_defaults()
public
static get_defaults() : mixed
Return values
mixed —get_product_attributes()
Prepare an associative array of attributes with the terms listed in the 'terms' property.
public
get_product_attributes(WC_Product $product) : array<string|int, mixed>
The keys of the array are the slugs of the attributes. The terms are returned as [ id, slug, name ] arrays
Parameters
- $product : WC_Product
-
The product to get the attributes for.
Tags
Return values
array<string|int, mixed> —The associative array with the product attributes used for the variations
get_term_thumbnails()
public
get_term_thumbnails(mixed $product) : mixed
Parameters
- $product : mixed
Return values
mixed —is_variation_visible()
public
is_variation_visible(mixed $variation) : mixed
Parameters
- $variation : mixed
Return values
mixed —process_data()
public
process_data(mixed $args) : mixed
Parameters
- $args : mixed
Return values
mixed —set_args()
public
set_args(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>
Return values
mixed —set_settings()
public
set_settings(mixed $args) : mixed
Parameters
- $args : mixed
Return values
mixed —parse_args()
private
parse_args(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>
Return values
mixed —recursive_merge()
private
recursive_merge(mixed $array[, mixed $force_associative = false ]) : mixed
Parameters
- $array : mixed
- $force_associative : mixed = false