John Davidson

php - Disable tax calculation and tax information on a cart page

0 comments
Message:


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:




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)?



My Answer:
To completely remove tax calculation and information from the cart page without editing too much of the source files, you can try the following approach:

1. Use CSS to hide the tax information on the cart page:
You can use CSS to hide the tax information on the cart page. Add the following CSS code to your theme's style.css file or in the Customizer:

css
.cart_totals .cart-subtotal .tax_label,
.cart_totals .cart-subtotal .tax_amount {
display: none;
}


This will hide the tax label and amount from the cart page.

2. Use a plugin to disable tax calculation on the cart page:
You can use a plugin like "WooCommerce Disable Tax" to disable tax calculation on the cart page. Install and activate the plugin, and then configure it to disable tax calculation on the cart page.

By using these methods, you should be able to remove tax calculation and information from the cart page without editing too much of the source files.

Rate this post

4 of 5 based on 8824 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us