[Support request] customize “Related Products” text for a specific product

Home Forums Support customize “Related Products” text for a specific product

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1499209
    Long

    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 );
    #1499212
    Leo
    Staff
    Customer Support

    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.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.