WC_Cart_Totals::get_discounted_price_in_cents()
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() WC Cart Totals::get discounted price in cents code WC 9.5.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; }