Site logo

[Resolved] gettext filter not working for woocommerce

Home Forums Support [Resolved] gettext filter not working for woocommerce

Home Forums Support gettext filter not working for woocommerce

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1713066
    Jackson

    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.

    #1713274
    David
    Staff
    Customer Support

    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

    #1713375
    Jackson

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

    #1713756
    David
    Staff
    Customer Support

    You’re welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.