WC_Cart_Totals::get_values_for_total()protectedWC 1.0

Returns array of values for totals calculation.

Method of the class: WC_Cart_Totals{}

No Hooks.

Return

Array. Items object

Usage

// protected - for code of main (parent) or child class
$result = $this->get_values_for_total( $field );
$field(string) (required)
Field name. Will probably be total or subtotal.

WC_Cart_Totals::get_values_for_total() code WC 8.7.0

protected function get_values_for_total( $field ) {
	return array_values( wp_list_pluck( $this->items, $field ) );
}