WC_Product_Variable_Data_Store_CPT::read_product_data()protectedWC 3.0.0

Read product data.

Method of the class: WC_Product_Variable_Data_Store_CPT{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->read_product_data( $product );
$product(WC_Product) (required) (passed by reference — &)
Product object.

Changelog

Since 3.0.0 Introduced.

WC_Product_Variable_Data_Store_CPT::read_product_data() code WC 8.7.0

protected function read_product_data( &$product ) {
	parent::read_product_data( $product );

	// Make sure data which does not apply to variables is unset.
	$product->set_regular_price( '' );
	$product->set_sale_price( '' );
}