Buy B2BKing
$299 $199
Are you looking to change a specific word or phrase in the plugin, but without switching to a different language?
For example:
Here's what you should know:
1) If you're looking to translate the plugin to a different language, this is not the right article. Please see our dedicated translation guide instead.
2) Some texts can be changed directly in B2BKing → Settings → Language & Text. To change the names of registration options and roles, go to B2BKing → Registration Roles / Registration Options and edit the fields there.
3) For all other text, you can use one of the two methods below.
Here's an example of how to change "request custom quote" to "request a quotation" using Loco Translate:
In the image above, our website language is English (United States), so we create a translation in the same language. Of course, this is not an actual translation since we're not changing the site language - it's simply a method that allows us to easily replace any text. The text you enter here will overwrite the original.
3. Find the text you want to change, and type in the new version.
4. Click Save, and that's it.
When you visit the Cart page, you will see the updated text:
Note: You can actually remove the Loco Translate plugin after you're done. The changes work through the standard WordPress translation system — Loco is just a translation editor. However, if you do remove it, make sure the translation file location is set to "System", not "Custom" (which is stored under Loco's own folder). Otherwise, you may lose your changes.
Note: You can actually remove the Loco Translate plugin after you're done. The changes work through the standard WordPress translation system — Loco is just a translation editor.
However, if you do remove it, make sure the translation file location is set to "System", not "Custom" (which is stored under Loco's own folder). Otherwise, you may lose your changes.
If you prefer using a code snippet, simply add the following to your theme's functions.php file or any code snippets plugin:
add_filter( 'gettext', 'custom_translate_strings', 20, 3 ); function custom_translate_strings( $translated_text, $text, $domain ) { if ( $domain === 'b2bking' ) { if ( $text === 'Request a quote' ) { $translated_text = 'Request a quotation'; } if ( $text === 'subaccount' ) { $translated_text = 'employee account'; } if ( $text === 'Subaccount' ) { $translated_text = 'Employee account'; } if ( $text === 'Subaccounts' ) { $translated_text = 'Employee accounts'; } } return $translated_text; }
You can add more text replacements to this snippet as needed.
Important: This only works with exact matches. The text in your code must match the full original string exactly as it appears in the translation template. Even small differences like an extra period (.) will cause it not to work for example, "subaccount" and "subaccount." are not the same. This is why you may prefer using Loco Translate (Option A), at least to search through all the plugin's strings and find the exact text you need to match.
Important: This only works with exact matches. The text in your code must match the full original string exactly as it appears in the translation template. Even small differences like an extra period (.) will cause it not to work for example, "subaccount" and "subaccount." are not the same.
This is why you may prefer using Loco Translate (Option A), at least to search through all the plugin's strings and find the exact text you need to match.
Powered by BetterDocs