WC_Order_Item_Coupon_Data_Store::read( WC_Order_Item_Coupon $item )

Read/populate data properties specific to this order item.


Description Description


Parameters Parameters

$item

(Required) Coupon order item.


Top ↑

Source Source

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

	public function read( &$item ) {
		parent::read( $item );
		$id = $item->get_id();
		$item->set_props(
			array(
				'discount'     => get_metadata( 'order_item', $id, 'discount_amount', true ),
				'discount_tax' => get_metadata( 'order_item', $id, 'discount_amount_tax', 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.