Archived topic
gettext filter not working for woocommerce
3 replies · Started by Jackson on March 28, 2021
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.
Hi there,
this is a question for Woocommerce, as the Theme is not responsible for the plugins output - but you should be able to change that within the Woo settings - see the reply to this topic here:
https://wordpress.org/support/topic/vat-to-gst/#post-13473808
Thanks David for reply. I will find my Luck there.
You're welcome