This topic has 5 replies, 2 voices, and was last updated 2 years, 5 months ago ago by Rose Tyler
hi, i am trying to change related product text to something else, for that I am using a PHP code but that is not working.
the code is:
// Change WooCommerce “Related products” text
add_filter(‘gettext’, ‘change_rp_text’, 10, 3);
add_filter(‘ngettext’, ‘change_rp_text’, 10, 3);
function change_rp_text($translated, $text, $domain)
{
if ($text === ‘Related products’ && $domain === ‘woocommerce’) {
$translated = esc_html__(‘Check out our other products’, $domain);
}
return $translated;
}
Can you find me a better solution to change related products to something else on the product page?
Hello,
This text comes from the theme, so you can use translation files to change it. Install and activate Loco Translate plugin > create a translation for XStore theme > change English text and disable the Loco plugin https://www.8theme.com/documentation/xstore/theme-translation/base-theme-translation/
Regards
It wroked.
Thank you very much.
You’re welcome!
Have a nice day!
Regards
Hello,
We’d appreciate if you could take a moment to give us 5-stars on ThemeForest! https://themeforest.net/downloads
Regards
Tagged: best selling, json array, persuasive, product text, related reviews, themes, woocommerce
The issue related to '‘change related product text to related reviews’' has been successfully resolved, and the topic is now closed for further responses