New Landing How can we help? Themeforest Theme Support Neighborhood Change "You may also like…" text

Viewing 4 posts - 1 through 4 (of 4 total)
  • #123913
    GTS75
    Member
    Post count: 240

    Are you able to change the text for the “You may also like…” widget in the related products section?

    #123932
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this php code at child theme’s functions.php file.

    function sf_text_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
    case 'Related Products' :
    //you need to change Related Products text
    $translated_text = __( 'Related Products', 'woocommerce' );
    break;
    }
    return $translated_text;
    }
    add_filter( 'gettext', 'sf_text_strings', 20, 3 );
    

    Thanks
    Mohammad

    #124201
    GTS75
    Member
    Post count: 240

    Thanks Mohammad – I’m new to updating php files…are you able to provide a breakdown of how to do that? Is there a certain line I need to place the code? Do I REPLACE old code?

    thanks for the help

    #124205
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You need to insert code at end of file and wrap code with php tag like:

    <?php 
    //Your code
    function sf_text_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
    case 'Related Products' :
    //you need to change Related Products text
    $translated_text = __( 'Related Products', 'woocommerce' );
    break;
    }
    return $translated_text;
    }
    add_filter( 'gettext', 'sf_text_strings', 20, 3 );
    ?>

    Thanks
    Mohammad

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register