Site logo

Archived topic

GP and WooCommerce: change related product text

5 replies · Started by Samuel on August 13, 2019

Viewing posts 1–6 of 6

I use GP and WooCommerce in German. What is the most effective way to change the text "Ähnliche Produkte" to something like "EXAMPLE" with GP? Preferably via function.php

Screeenshot: http://prntscr.com/os5lgj

Hi there,

this is the filter i would use to translate the text:

add_filter( 'gettext', function( $translated_text ) {
    if ( 'Related products' === $translated_text ) {
        $translated_text = 'Your new text here';
    }

    return $translated_text;
} );

Just need to change the text you're looking for and add the translated text you want.

Amazing thx!

You're welcome - its a real handy filter in WP for dealing with those elements that don't have their own filter.

Hi @David,
that code now no longer works?
Thanks

Hi vincenzoquarta,

Can you open a new topic and link us to your site?
Let me know :)

This archived topic is closed to new replies.