This article will guide you replace Includes Tax text in WooCommerce Cart & Checkout Page. WooCommerce offers a strong and flexible Taxation system . You can implement almost any tax system in it.
WooCommerce also offers lots of extension to increase features of TAX system in your website. WooCommerce globally consider TAX system as VAT, however we can edit the VAT text to required TAX name in shop display. There is no available option in WooCommerce to change the VAT text in cart and checkout page.
Table of Contents
Query about replace Includes Tax text in WooCommerce Cart page
Recently one of our client ask us to change the “Inclusive TAX” as “Inclusive GST” in cart and Checkout page. So we used a simple code which will be added in functions.php file of child theme to change the VAT to GST text. You can also change “ex VAT” tax in cart an checkout page to “ex GST” by adding second code in your functions.php file.
You can also change “Inclusive VAT” tax to “Inclusive GST” on single total in cart and checkout page. if your TAX is inclusive of price and show as a single total on cart and checkout page, add below code in functions.php file.
If Your TAX on Cart and checkout page is as single total then copy below code on your functions.php file
add_filter( 'woocommerce_countries_tax_or_vat', function () {
return __( 'GST', 'woocommerce' );
});
Similarly if the TAX is inclusive or exclusive then use below codes as required.
add_filter( 'woocommerce_countries_inc_tax_or_vat', function () {
return __( 'GST', 'woocommerce' );
});
add_filter( 'woocommerce_countries_ex_tax_or_vat', function () {
return __( 'GST', 'woocommerce' );
});
If you want to:
- Change “inclusive TAX” to “Inclusive GST” on cart and checkout page
- Change “ex VAT” to “ex GST” on cart and checkout page
You can use below code in your child theme’s functions.php file to show your TAX name.
function woo_rename_tax_inc_cart( $value ) {
$value = str_ireplace( 'Tax', 'GST', $value );
return $value;
}
Please note : You can add any TAX name in above code to get the required tax name in cart and checkout page of woocommerce.
If you want to change Ex VAT to Ex GST or to something else , you can add the below code in your functions.php file
add_filter( 'gettext', function( $translation, $text, $domain ) {
if ( $domain == 'woocommerce' ) {
if ( $text == '(ex. VAT)' ) { $translation = '(ex. GST)'; }
}
return $translation;
}, 10, 3 );
UPDATE : Replace Includes Tax text in WooCommerce Cart
Now you name the TAX text (Value) in tax class. So when you add the tax rate in TAX slab, you can give name to your TAX type which will show on front end. Check images below.
To know how to add GST in WooCommerce. You can read our this blog. So that all you need to do to replace Includes Tax text in WooCommerce Cart and Checkout Page. Let us know if you have any queries or Contact our Developer team for help.
Happy Coding!
[caldera_form id=”CF60ca2e3ccf64f”]
doesnt work
hi,
Now you name the TAX text (Value) in tax class. So when you add the tax rate in TAX slab, you can give name to your TAX type which will show on front end.
We also updated the blog. Check again.
Regards
hi,
Please add this code in your functions.php file
add_filter( ‘gettext’, function( $translation, $text, $domain ) {
if ( $domain == ‘woocommerce’ ) {
if ( $text == ‘(ex. VAT)’ ) { $translation = ‘(ex. GST)’; }
}
return $translation;
}, 10, 3 );
Regards