woocommerce_calculate_totals

woocommerce_calculate_totals

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

do_action('woocommerce_calculate_totals') is found 1 times:

  • /includes/class-wc-cart-totals.php line 881
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
            $this->cart->set_total_tax( $items_tax + $shipping_and_fee_taxes );
     
            // Allow plugins to hook and alter totals before final total is calculated.
            if ( has_action( 'woocommerce_calculate_totals' ) ) {
                do_action( 'woocommerce_calculate_totals', $this->cart );
            }
     
            // Allow plugins to filter the grand total, and sum the cart totals in case of modifications.
            $this->cart->set_total( max( 0, apply_filters( 'woocommerce_calculated_total', $this->get_total( 'total' ), $this->cart ) ) );
        }
    }