WC_Product_Variable_Data_Store_Interface
in
WC Product Variable Data Store Interface
Functions that must be defined by product variable store classes.
Tags
Table of Contents
- child_has_dimensions() : bool
- Does a child have dimensions set?
- child_has_weight() : bool
- Does a child have a weight set?
- child_is_in_stock() : bool
- Is a child in stock?
- delete_variations() : mixed
- Delete variations of a product.
- sync_managed_variation_stock_status() : mixed
- Stock managed at the parent level - update children being managed by this product.
- sync_price() : mixed
- Sync variable product prices with children.
- sync_variation_names() : mixed
- Syncs all variation names if the parent name is changed.
- untrash_variations() : mixed
- Untrash variations.
Methods
child_has_dimensions()
Does a child have dimensions set?
public
child_has_dimensions(WC_Product $product) : bool
Parameters
- $product : WC_Product
-
Product object.
Return values
bool —child_has_weight()
Does a child have a weight set?
public
child_has_weight(WC_Product $product) : bool
Parameters
- $product : WC_Product
-
Product object.
Return values
bool —child_is_in_stock()
Is a child in stock?
public
child_is_in_stock(WC_Product $product) : bool
Parameters
- $product : WC_Product
-
Product object.
Return values
bool —delete_variations()
Delete variations of a product.
public
delete_variations(int $product_id[, bool $force_delete = false ]) : mixed
Parameters
- $product_id : int
-
Product ID.
- $force_delete : bool = false
-
False to trash.
Return values
mixed —sync_managed_variation_stock_status()
Stock managed at the parent level - update children being managed by this product.
public
sync_managed_variation_stock_status(WC_Product &$product) : mixed
This sync function syncs downwards (from parent to child) when the variable product is saved.
Parameters
- $product : WC_Product
-
Product object.
Return values
mixed —sync_price()
Sync variable product prices with children.
public
sync_price(WC_Product|int &$product) : mixed
Parameters
- $product : WC_Product|int
-
Product object or ID.
Return values
mixed —sync_variation_names()
Syncs all variation names if the parent name is changed.
public
sync_variation_names(WC_Product &$product[, string $previous_name = '' ][, string $new_name = '' ]) : mixed
Parameters
- $product : WC_Product
-
Product object.
- $previous_name : string = ''
-
Previous name.
- $new_name : string = ''
-
New name.
Return values
mixed —untrash_variations()
Untrash variations.
public
untrash_variations(int $product_id) : mixed
Parameters
- $product_id : int
-
Product ID.