WordPress at Your Fingertips
function is not described

WC_Cart_Totals::get_discounted_price_in_cents() protected WC 3.2.0

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

{} It's a 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.

Code of WC_Cart_Totals::get_discounted_price_in_cents() WC 5.9.0

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;
}