Archived topic
customize "Related Products" text for a specific product
1 reply · Started by jasond on October 21, 2020
Viewing posts 1–2 of 2
I'm using this snippet to change the Related Products text. Is there any way we can do this for a specific product?
function custom_related_products_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related products' :
$translated_text = __( 'Other items you might like', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'custom_related_products_text', 20, 3 );
Hi there,
I did a quick Google search and believe is_single() should work:
https://github.com/woocommerce/woocommerce/issues/1300
This is handled by WooCommerce though so if this doesn't work then it might be worth checking with their support team.
This archived topic is closed to new replies.