WC_Abstract_Order::get_values_for_total
Return array of values for calculations.
Method of the class: WC_Abstract_Order{}
No Hooks.
Returns
Array. Array of values.
Usage
// protected - for code of main (parent) or child class $result = $this->get_values_for_total( $field );
- $field(string) (required)
- Field name to return.
WC_Abstract_Order::get_values_for_total() WC Abstract Order::get values for total code WC 10.7.0
protected function get_values_for_total( $field ) {
$items = array_map(
function ( $item ) use ( $field ) {
return wc_add_number_precision( (float) $item[ $field ], false );
},
array_values( $this->get_items() )
);
return $items;
}