WC_Cart_Totals::get_totals
Get all totals with or without precision (in cents).
Method of the class: WC_Cart_Totals{}
No Hooks.
Returns
Array..
Usage
$WC_Cart_Totals = new WC_Cart_Totals(); $WC_Cart_Totals->get_totals( $in_cents );
- $in_cents(true|false)
- Should the totals be returned in cents, or without precision.
Default: false
Changelog
| Since 3.2.0 | Introduced. |
WC_Cart_Totals::get_totals() WC Cart Totals::get totals code WC 10.3.6
public function get_totals( $in_cents = false ) {
return $in_cents ? $this->totals : wc_remove_number_precision_deep( $this->totals );
}