Public Ticket #3815583

Web Hook Updates

Closed
Comments
8 Tickets 6
Matthew started the conversation 2 years ago on February 6, 2025 at 4:05pm

Hello,

I keep searching in the documents to update some items but haven't seen the full plugin docs to fix things on my own!  But I need to change the Switch to Agent button title text to Switch to Sales Rep, when a sales rep is shopping as a customer. 


I don't see any other buttons for Agents.  I appreciate the help.

Attached files:

2,762
KingsPlugins replied 2 years ago on February 7, 2025 at 2:48pm

Hello Matthew,

To change that text there, you can add the following PHP code snippet to your site:

add_filter('gettext', 'change_agent_text', 20, 3);
function change_agent_text($translated, $original, $domain) {
    if ($original === 'Switch to Agent') {
        return 'Switch to Sales Rep';
    }
    return $translated;
}

 

This can be added to functions.php or to any code snippets plugin.

 

If necessary, you can extend this code, and add additional texts, for example:

add_filter('gettext', 'change_agent_text', 20, 3);
function change_agent_text($translated, $original, $domain) {
    if ($original === 'Switch to Agent') {
        return 'Switch to Sales Rep';
    }
    if ($original === 'Your text here 1...') {
        return 'Another text here 1...';
    }
    if ($original === 'Your text here 2...') {
        return 'Another text here 2...';
    }
    return $translated;
}

 

Kind regards,

Stefan

1

Sign In