66
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!
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://tutoraspire.com
*/
add_filter( 'woocommerce_product_upsells_products_heading', 'tutoraspire_translate_may_also_like' );
function tutoraspire_translate_may_also_like() {
return 'Customers also purchased...';
}