woocommerce_price_inc_tax_amount

Calc tax from inclusive price.

Description

(array) apply_filters( 'woocommerce_price_inc_tax_amount', (number) $tax_amount, (unknown) $key, (unknown) $rate, (unknown) $price ); 

Returns (array)

Parameters (4)

0. $tax_amount (number)
The tax amount.
1. $key (unknown)
The key.
2. $rate (unknown)
The rate.
3. $price (unknown)
The price.

Usage

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

Defined (1)

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

/includes/class-wc-tax.php  
  1. $taxes[ $key ] += apply_filters( 'woocommerce_price_inc_tax_amount', $tax_amount, $key, $rate, $price );