0

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.

1

OR the dirty way

Build a form method="get" and action="domain.com/catalogsearch/result/ Inside the form put a text field with name="q"

You have to validate it though. I leave experimentation on you.

  • This looks like it will work. Thank you for the help. – Tyler Jensen Oct 27 '16 at 18:06
0

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

https://premium.wpmudev.org/blog/build-your-own-custom-wordpress-search/?sul=b&utm_expid=3606929-90.6a_uo883STWy99lnGf8x1g.1&utm_referrer=https%3A%2F%2Fwww.google.com%2F

  • How to Create a Simple WordPress Plugin

http://wpninjas.com/how-to-create-a-simple-wordpress-plugin/

  • Getting the SQL Query for Magento Fulltext Search

http://sleepycow.org/2014/11/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.

  • Thanks for the response. I looked through what you sent but I don't know if it will work. I am not trying to search the Wordpress database, I am trying to search the Magento database. I want the exact some functionality as the Magento site. – Tyler Jensen Oct 27 '16 at 18:05
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.