In this woocommerce tutorial for beginners you will learn how to change related product title text in single product page using custom php snippet in wordpress website.
* Use code to change related products text.
// 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;
}
* In code you see text ” Check out our other products ” so you can change this text according to your requirement.
* In code you see default text ” Related products ” so you can change this text according to your theme text mean in some theme show ” Related Products ” in single product page.
#woocommerce #relatedproducts #products #text #wordpress #wordpresstutorial #webtaskwithhassan #hassangilani
#Change #Related #Products #Text #Product #Pages #WooCommerce #WordPress