Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #764797

    skog97
    Participant

    Can’t change the text of the apply coupon in my cart section,
    please help

    //William

    #764954

    Thai
    Moderator

    Hi William,

    Thanks for writing in!

    In order to translate those strings, you can simply use following code in your child theme’s functions.php file:

    add_filter('gettext', 'x_translate_text' , 20, 3);
    function x_translate_text ( $translated_text, $text, $domain ) {
    
    $translation = array (
    'Apply Coupon' => 'Your new text'
    );
    
    if( isset( $translation[$text] ) ) {
    return $translation[$text];
    }
    
    return $translated_text;
    
    }

    Hope it helps.

    #773041

    skog97
    Participant

    Thank you X you are the best!

    Kind regards William

    #773194

    Nico
    Moderator

    You’re most welcome.

    Feel free to ask us again.

    Have a great day! 🙂