How can I change the way search results are listed in Woo Commerce?
I'm using WooCommerce as a directory and I want the search results to show up differently.
Right now, when you do a search, you get this:
Rather than saying, "Products," I'd like it to say, "Resources." How can I change that?
Thanks!
WordPress
Last Comment
Bruce Gust
8/22/2022 - Mon
Randy Downs
See if this helps. In the form below. It looks like the code is echoing 'Search Products…' but I don't see that in your example. You could try changing Products to Resources but I would be cautious & maybe copy the line input line or the entire form and comment it out before making the change on the copy.
When using English language and you want to change to a different English string. This is the way to do using a simple snippet code see the examples from this page https://www.businessbloomer.com/translate-single-string-woocommerce-wordpress/ Based on their example just replace to use it with the correct string
case 'Products' : $translated = 'Ressources';break;
When you need to change a string that is not in English you can simply use Poedit to edit the language file
*Note: You may need to changer other relates strings that contain the word you changed...
Bruce Gust
ASKER
Thank you, gentlemen!
Here's what I did:
I couldn't figure out how to eliminate the "Products" dynamic on the default tooltip, even with your suggestions, but...
...your input inspired a different direction and it turned out to be a winner.
I disabled the search icon using the Theme's option and then I installed a plugin that searched the Woo Commerce catalog only. I could dictate how the results were displayed with that approach.
As far as the default functionality, I downloaded another plugin that allowed me to attach an image to a menu item. I used the conventional magnifying glass and attached the link that opened up a search page. The page displays whatever the user is looking for without the headings that were my nemesis in the tooltip.
So, I may have taken the long way around to get it done, but I was able to make it happen!
Open in new window