I found a solution online for this but it does not seem to work.
It says to edit the below file which I did a few days ago but somehow it is not working still.
/wp-content/plugins/woocommerce/templates/single-product/related.php
Which if I FTP to the server the file shows the below:
if ( $products->have_posts() ) : ?>
<div class="related products">
<h2><?php _e('You may also like', 'woocommerce' ); ?></h2>
However the webpage still shows ‘Related products’ and not ‘You may also like’
For some reason this is not taking place or being over ridden somewhere.
Any ideas?
i found this for the child functions.php: http://speakinginbytes.com/2013/10/gettext-filter-wordpress/
it works well here: https://mo-sound.com/en/shop/ball-speaker-classic-white/
The best way to override default templates is to copy the file to a folder named
/woocommerce/single-product
inside your current theme. Make changes to that file.In general to override Woocommerce template files like
/wp-content/plugins/woocommerce/templates/<foldername>/<filename>
you copy the file to
/wp-content/<your-theme>/woocommerce/<foldername>/<filename>
Here is
user5217948
‘s code with the needed case update fromFrithir
:This code works with WooCommerce 3.3.1 and WordPress 4.9.4 (both circa Feb 2018).
.
A friendly tip for those that have woocommerce/wordpress in another language
You would have to replace ‘Related Products’ to the text that is showing up on your language. In my case, related products translates to “productos relacionados”
Code to include in functions.php file
2020 Update
Instead of the suggested search-and-replace method, there is now a filter you can use, which is more accurate.
You add this snippet to your functions.php file, in your child theme.
A little PHP snippet. Place PHP snippets at the bottom of your child theme functions.php file:
wp-content/themes/mythemename/functions.php
I have just used the following code successfully on one of my own sites. It needs to be placed in the functions.php in your child theme. Replace ‘Your Custom Text Here’ with the words you wish to use.