woocommerce_get_order_item_totals

The WooCommerce woocommerce get order item totals hook.

Description

apply_filters( 'woocommerce_get_order_item_totals', (number) $total_rows, (unknown) $instance, (unknown) $tax_display ); 

Parameters (3)

0. $total_rows (number)
The total rows.
1. $instance (unknown)
The instance.
2. $tax_display (unknown)
The tax display.

Usage

To run the hook, copy the example below.
  1. $total_rows = apply_filters( 'woocommerce_get_order_item_totals', $total_rows, $instance, $tax_display ); 
  2.  
  3. if ( !empty( $total_rows ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_get_order_item_totals callback 
  2. function filter_woocommerce_get_order_item_totals( $total_rows, $instance, $tax_display ) { 
  3. // make filter magic happen here... 
  4. return $total_rows
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_get_order_item_totals', 'filter_woocommerce_get_order_item_totals', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_get_order_item_totals', 'filter_woocommerce_get_order_item_totals', 10, 3 ); 

Defined (2)

The filter is defined in the following location(s).

/includes/class-wc-order.php  
  1. return apply_filters( 'woocommerce_get_order_item_totals', $total_rows, $this, $tax_display ); 
/includes/abstracts/abstract-wc-order.php  
  1. return apply_filters( 'woocommerce_get_order_item_totals', $total_rows, $this, $tax_display );