Home » WooCommerce: Translate “You may also like…” Text

WooCommerce: Translate “You may also like…” Text

by Tutorials Info

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 tutoraspire.com FREE
 * @author        Tutor Aspire
 * @compatible    WooCommerce 4.1.1
 * @donate $9     https://www.tutoraspire.com
 */
 
add_filter( 'woocommerce_product_upsells_products_heading', 'tutoraspire_translate_may_also_like' );
 
function tutoraspire_translate_may_also_like() {
   return 'Customers also purchased...';
}

You may also like