WC_Cart_Totals::get_discounted_price_in_cents()protectedWC 3.2.0

Get discounted price of an item with precision (in cents).

Method of the class: WC_Cart_Totals{}

No Hooks.

Return

Int.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_discounted_price_in_cents( $item_key );
$item_key(object) (required)
Item to get the price of.

Changelog

Since 3.2.0 Introduced.

WC_Cart_Totals::get_discounted_price_in_cents() code WC 8.6.1

protected function get_discounted_price_in_cents( $item_key ) {
	$item  = $this->items[ $item_key ];
	$price = isset( $this->coupon_discount_totals[ $item_key ] ) ? $item->price - $this->coupon_discount_totals[ $item_key ] : $item->price;
	return $price;
}