Site logo

Archived topic

gettext filter not working for woocommerce

3 replies · Started by Jackson on March 28, 2021

Viewing posts 1–4 of 4

I want the theme to display GST instead of VAT. Searched everywhere, found a gettext filter. But doesn't work for me. Would you please spread some light?. I don't want to use any plugins. Below is the code that I have tried.

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

All this is needed for the Checkout Page only. The SubTotal and Individual prices are shown in VAT and the Total is shown in GST as per the tax slabs.

Thanks David for reply. I will find my Luck there.

You're welcome

This archived topic is closed to new replies.