woocommerce_cart_remove_taxes_zero_rate_id

woocommerce_cart_remove_taxes_zero_rate_id

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_cart_remove_taxes_zero_rate_id') is found 2 times:

  • /includes/class-wc-cart.php line 882
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    foreach ( $taxes as $key => $tax ) {
        $code = WC_Tax::get_rate_code( $key );
     
        if ( $code || apply_filters( 'woocommerce_cart_remove_taxes_zero_rate_id', 'zero-rated' ) === $key ) {
            if ( ! isset( $tax_totals[ $code ] ) ) {
                $tax_totals[ $code ]         = new stdClass();
                $tax_totals[ $code ]->amount = 0;
            }
     
            $tax_totals[ $code ]->tax_rate_id = $key;
  • /includes/class-wc-checkout.php line 674
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    * @since 3.0.0 or earlier
     *
     * @param string $tax_rate_id The ID of the zero rate tax.
     */
    if ( $tax_rate_id && apply_filters( 'woocommerce_cart_remove_taxes_zero_rate_id', 'zero-rated' ) !== $tax_rate_id ) {
        $item = new WC_Order_Item_Tax();
        $item->set_props(
            array(
                'rate_id'            => $tax_rate_id,
                'tax_total'          => $cart->get_tax_amount( $tax_rate_id ),
                'shipping_tax_total' => $cart->get_shipping_tax_amount( $tax_rate_id ),