PHP Class WC_Product_Variable_Data_Store_CPT

Author: WooThemes
Inheritance: extends WC_Product_Data_Store_CPT, implements WC_Object_Data_Store_Interface, implements WC_Product_Variable_Data_Store_Interface
Afficher le fichier Open project: woocommerce/woocommerce

Méthodes publiques

Méthode Description
child_has_dimensions ( $product ) : boolean Does a child have dimensions set?
child_has_weight ( $product ) : boolean Does a child have a weight set?
child_is_in_stock ( $product ) : boolean Is a child in stock?
read_children ( &$product, boolean $force_read = false ) : WC_Product Loads variation child IDs.
sync_managed_variation_stock_status ( &$product ) Stock managed at the parent level - update children being managed by this product.
sync_price ( WC_Product | integer &$product ) Sync variable product prices with children.
sync_stock_status ( WC_Product | integer &$product ) Sync variable product stock status with children.

Méthodes protégées

Méthode Description
read_product_data ( &$product ) Read product data.

Private Methods

Méthode Description
read_price_data ( &$product, boolean $include_taxes = false ) Get an array of all sale and regular prices from all variations. This is used for example when displaying the price range at variable product level or seeing if the variable product is on sale.
read_variation_attributes ( &$product ) Loads an array of attributes used for variations, as well as their possible values.

Method Details

child_has_dimensions() public méthode

Does a child have dimensions set?
Since: 2.7.0
public child_has_dimensions ( $product ) : boolean
Résultat boolean

child_has_weight() public méthode

Does a child have a weight set?
Since: 2.7.0
public child_has_weight ( $product ) : boolean
Résultat boolean

child_is_in_stock() public méthode

Is a child in stock?
Since: 2.7.0
public child_is_in_stock ( $product ) : boolean
Résultat boolean

read_children() public méthode

Loads variation child IDs.
public read_children ( &$product, boolean $force_read = false ) : WC_Product
$force_read boolean True to bypass the transient.
Résultat WC_Product

read_product_data() protected méthode

Read product data.
Since: 2.7.0
protected read_product_data ( &$product )

sync_managed_variation_stock_status() public méthode

This sync function syncs downwards (from parent to child) when the variable product is saved.
Since: 2.7.0

sync_price() public méthode

Sync variable product prices with children.
Since: 2.7.0
public sync_price ( WC_Product | integer &$product )
$product WC_Product | integer

sync_stock_status() public méthode

Change does not persist unless saved by caller.
Since: 2.7.0
public sync_stock_status ( WC_Product | integer &$product )
$product WC_Product | integer