Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • I just recently started using WP and came across the same issue and found threads that are years old but no one pointing out what the issue is. When you look at the file class-wc-countries.php(woocommerce), then you’ll find the hardcoded issue. There are a few functions like inc_tax_or_vat and ex_tax_or_vat. Basically there is a list of VAT countries which get VAT displayed and all other countries have hardcoded Tax.
    Changing those functions is no good as it gets removed after an upgrade of woocommerce. However, the functions reveal what text is used which can be translated. So try this:

    add_filter( 'gettext', function( $translation, $text, $domain ) {
    			if ( $domain == 'woocommerce' ) {
    				if ( $text == '(incl. tax)' ) { $translation = '(incl. GST)'; }
    				if ( $text == '(ex. tax)' ) { $translation = '(ex. GST)'; }
    				if ( $text == 'Tax' ) { $translation = 'GST'; }
    			}
    			return $translation;
    		}, 10, 3 );

    They should really fix this and build in an option to override this or use the existing setting for your tax name. There are many countries where you just have one tax to deal with and it would had been great if you could just set it.

    Hope this helps some of you.

    I just recently started using WP and came across the same issue and found threads that are years old but no one pointing out what the issue is. When you look at the file class-wc-countries.php(woocommerce), then you’ll find the hardcoded issue. There are a few functions like inc_tax_or_vat and ex_tax_or_vat. Basically there is a list of VAT countries which get VAT displayed and all other countries have hardcoded Tax.
    Changing those functions is no good as it gets removed after an upgrade of woocommerce. However, the functions reveal what text is used which can be translated. So try this:

    add_filter( 'gettext', function( $translation, $text, $domain ) {
    			if ( $domain == 'woocommerce' ) {
    				if ( $text == '(incl. tax)' ) { $translation = '(incl. GST)'; }
    				if ( $text == '(ex. tax)' ) { $translation = '(ex. GST)'; }
    				if ( $text == 'Tax' ) { $translation = 'GST'; }
    			}
    			return $translation;
    		}, 10, 3 );

    They should really fix this and build in an option to override this or use the existing setting for your tax name. There are many countries where you just have one tax to deal with and it would had been great if you could just set it.

    Hope this helps some of you.

Viewing 2 replies - 1 through 2 (of 2 total)