I have a Magento site with a Wordpress blog under a sub directory. The header of the Magento site has a search bar and I would like to add the search bar to the header of the Wordpress site. How would I go about doing that? I know Fishpig does it but that removes too many other things I need.
OR the dirty way
Build a form
Inside the form put a text field with
You have to validate it though. I leave experimentation on you.
I read this post and I feel like you may be needing a little nudge in a direction that I am not sure you have considered. Perhaps it will spark some creativity, who knows?
So you want to add a Magento search bar into a Wordpress site. You know about Fishpig, but you don't like it. So with that information alone what is it that we can deduce?
Magento and Wordpress are two different PHP frameworks with two different databases. Sounds to me like you are going to have to alter Wordpress to include a search bar that queries the same way that the Magento search bar does. Rather than "Add the search bar", create a plug-in for Wordpress.
Here is some information to get you on the right path:
- Build Your Own Custom WordPress Search, by Chris Kowles
- How to Create a Simple WordPress Plugin
- Getting the SQL Query for Magento Fulltext Search
Good luck, Tyler. I am in no way answering your question directly as you probably hoped, but I hope that by reading this I am nudging you in a direction that you hadn't considered and that you will now take the programmers approach to this issue.
Also the above references were quickly gathered and slightly glanced through, so make sure you continue your own research into the matter and you can get it done.
I want to add another approach, the API approach.
Indeed, you need to create a custom module in WordPress.
But you can use Magento API in order to avoid SQL Query for Magento. You may need to create your custom Magento API, depending of your needs.