WordPress at Your Fingertips
function is not described

WC_Order_Item_Product_Data_Store::read() public WC 3.0.0

Read/populate data properties specific to this order item.

{} It's a method of the class: WC_Order_Item_Product_Data_Store{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Order_Item_Product_Data_Store = new WC_Order_Item_Product_Data_Store();
$WC_Order_Item_Product_Data_Store->read( $item );
$item(WC_Order_Item_Product) (required) (passed by reference — &)
Product order item object.

Changelog

Since 3.0.0 Introduced.

Code of WC_Order_Item_Product_Data_Store::read() WC 5.6.0

public function read( &$item ) {
	parent::read( $item );
	$id = $item->get_id();
	$item->set_props(
		array(
			'product_id'   => get_metadata( 'order_item', $id, '_product_id', true ),
			'variation_id' => get_metadata( 'order_item', $id, '_variation_id', true ),
			'quantity'     => get_metadata( 'order_item', $id, '_qty', true ),
			'tax_class'    => get_metadata( 'order_item', $id, '_tax_class', true ),
			'subtotal'     => get_metadata( 'order_item', $id, '_line_subtotal', true ),
			'total'        => get_metadata( 'order_item', $id, '_line_total', true ),
			'taxes'        => get_metadata( 'order_item', $id, '_line_tax_data', true ),
		)
	);
	$item->set_object_read( true );
}