WC_Order_Item_Tax_Data_Store::read( WC_Order_Item_Tax $item )

Read/populate data properties specific to this order item.


Description Description


Parameters Parameters

$item

(Required) Tax order item object.


Top ↑

Source Source

File: includes/data-stores/class-wc-order-item-tax-data-store.php

	public function read( &$item ) {
		parent::read( $item );
		$id = $item->get_id();
		$item->set_props(
			array(
				'rate_id'            => get_metadata( 'order_item', $id, 'rate_id', true ),
				'label'              => get_metadata( 'order_item', $id, 'label', true ),
				'compound'           => get_metadata( 'order_item', $id, 'compound', true ),
				'tax_total'          => get_metadata( 'order_item', $id, 'tax_amount', true ),
				'shipping_tax_total' => get_metadata( 'order_item', $id, 'shipping_tax_amount', true ),
				'rate_percent'       => get_metadata( 'order_item', $id, 'rate_percent', true ),
			)
		);
		$item->set_object_read( true );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.