Apparently, since WooCommerce 4.1, there is now an easy way to edit the “You may also like…” WooCommerce string thanks to a brand new “PHP filter”. Kudos to Damien Carbery for reporting this new method.

So, as usual, simply copy/paste the snippet below in your child theme’s functions.php and it will do what it says on the tin. Enjoy!

The “You may also like…” section displays on the single product page when “Upsells” are defined for that specific WooCommerce product

PHP Snippet: Edit / Translate “You may also like…” @ Single Product Page

/**
 * @snippet       Translate "You may also like..." - WooCommerce Single Product
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 4.1.1
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */
 
add_filter( 'woocommerce_product_upsells_products_heading', 'bbloomer_translate_may_also_like' );
 
function bbloomer_translate_may_also_like() {
   return 'Customers also purchased...';
}
Share:

Leave a Reply