• Hello all

    WordPress is fairly new to me and I am assessing if it is suitable to use for a redesign of a current website, which is a combination of static html and OpenCart. I was able to code the search box in the static html header to search the OpenCart database, and return the results within OpenCart.

    Is there a possibility of overriding the way WordPress searches, and replicate the same behaviour, so in a WordPress installation, when something is searched for, OpenCart opens and the results are displayed.

    It wouldn’t matter if the WordPress installation was no longer searchable – the key thing is from within every page of the website, a visitor needs to be able to search for a product and the results would load in the OpenCart section.

    Thanks in advance.

    Jonathan

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    A WordPress search request looks like this: example.com/index.php?s=search_term

    Of course, the search term thus is available as $_GET['s'] ( and as a query var farther into the WP request parsing ).

    It is really more of a matter of the OpenCart side of things being able to search on the value contained in $_GET['s']. I know nothing of OpenCart, but if you can swing that it should work fine.

    Thread Starter JonathanRi

    (@jonathanri)

    Thanks for replying bcworkz

    Opencart searches as:
    example.co.uk/search/index.php?route=product/search&search=(search query)

    So I don’t know if that presents a problem or not, and now the requirement is to retain the ability to search the WordPress section of the site as well as search for products on the Opencart section – so there would be a separate “Search Blog” button next to a “Search Products” button.

    Moderator bcworkz

    (@bcworkz)

    Separate search buttons certainly simplifies things in one way, though it does require the use of javascript to ensure the proper request is formed depending on which button was clicked.

    To avoid javascript, you would need completely separate search forms for each search type.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search an OpenCart site from within WordPress’ is closed to new replies.