wc_round_tax_total

The WooCommerce wc round tax total hook.

Description

apply_filters( 'wc_round_tax_total', (unknown) $rounded_tax, (unknown) $tax, (unknown) $dp, (unknown) $wc_tax_rounding_mode ); 

Parameters (4)

0. $rounded_tax (unknown)
The rounded tax.
1. $tax (unknown)
The tax.
2. $dp (unknown)
The dp.
3. $wc_tax_rounding_mode (unknown) => WC_TAX_ROUNDING_MODE
The wc tax rounding mode.

Usage

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

Defined (1)

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

/includes/wc-formatting-functions.php  
  1. return apply_filters( 'wc_round_tax_total', $rounded_tax, $tax, $dp, WC_TAX_ROUNDING_MODE );