New Landing How can we help? Atelier How to change the title "selected option"

Viewing 6 posts - 1 through 6 (of 6 total)
  • Posted in: Atelier
  • #213246
    Davinci
    Member
    Post count: 67

    How to change the title “selected option” on the different in each case?
    For example, choose a color, select the size.

    Attachments:
    You must be logged in to view attached files.
    #213291
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Please use this, the below is an example of how to change multiple strings:

    Make sure you put the exact text you want to change.

    function swift_wc_translate_text($translated) { 
       $translated = str_ireplace('Choose an option', 'Your Replacment Text', $translated); 
       $translated = str_ireplace('Choose an option TWO', 'Your Replacment Text TWO', $translated); 
       $translated = str_ireplace('Original Text THREE', 'Your Replacment Text THREE', $translated); 
    
       return $translated; 
    }
    add_filter('gettext', 'swift_wc_translate_text');
    add_filter('ngettext', 'swift_wc_translate_text');

    Thanks,
    David.

    #213395
    Davinci
    Member
    Post count: 67

    Specify, please, which file I need to make changes?

    #213460
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You need to insert this code at functions.php file of child theme.
    Thanks
    Mohammad

    #213646
    Davinci
    Member
    Post count: 67

    I add this code. Nothing has changed.
    “Choose an option TWO” – Where does this code?

    #213650
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    That is an example, it will look for the text and then replace that if it finds it.

    You need to change this to your own text:

    'Choose an option', 'Your Replacment Text'

    “Choose an option” is the string text being searched for.

    Thanks,
    David.

Viewing 6 posts - 1 through 6 (of 6 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