1

I would like to disable tax calculation and information on the cart page, to have them shown only on the checkout page.

I tried to disable woocommerce's 'wc_tax_enabled' like below:

    if ( class_exists( 'woocommerce') ) {
        if ( is_cart() ) {
            add_filter( 'wc_tax_enabled', '__return_false' );
        }
    }
});

The above works at a glance, but when I switch to a different delivery option or select any other available options, the tax calculation is still included in the total price on the cart page. See the image below:

Enter image description here

Enter image description here

I've also tried to edit total-carts.php to remove the tax information, but it produces a similar result as above.

How can I remove the tax calculation on the cart page entirely (if possible, without editing too much of the source files)?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
FlyingPenguin
  • 231
  • 1
  • 9
  • Does this answer your question? [How to remove Shipping from Woocommerce cart?](https://stackoverflow.com/questions/37304801/how-to-remove-shipping-from-woocommerce-cart) – Maytha8 Dec 28 '21 at 03:36

1 Answers1

0

From an answer to Stack Overflow question How can I remove Shipping from a WooCommerce cart?:

Add the following snippet to your functions.php file:

function disable_shipping_calc_on_cart( $show_shipping ) {
    if( is_cart() ) {
        return false;
    }
    return $show_shipping; 
} 
add_filter( 'woocommerce_cart_ready_to_calc_shipping', 'disable_shipping_calc_on_cart', 99 ); 
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Maytha8
  • 846
  • 1
  • 8
  • 26