WC_Abstract_Order::add_order_item_totals_subtotal_row()
Add total row for subtotal.
Method of the class: WC_Abstract_Order{}
No Hooks.
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->add_order_item_totals_subtotal_row( $total_rows, $tax_display );
- $total_rows(array) (required) (passed by reference — &)
- Reference to total rows array.
- $tax_display(string) (required)
- Excl or incl tax display mode.
WC_Abstract_Order::add_order_item_totals_subtotal_row() WC Abstract Order::add order item totals subtotal row code WC 9.7.1
protected function add_order_item_totals_subtotal_row( &$total_rows, $tax_display ) { $subtotal = $this->get_subtotal_to_display( false, $tax_display ); if ( $subtotal ) { $total_rows['cart_subtotal'] = array( 'type' => 'subtotal', 'label' => __( 'Subtotal:', 'woocommerce' ), 'value' => $subtotal, ); } }