Search code examples
phpsearchshopping-cartadvanced-searchinterspire-shopping-cart

interspire, shopping cart product, search functionality


I am facing an Issue in a website built using Interspire CMS / Shopping Cart Product, actually am new in this CMS and am not the developer who created this Website, I received a call from the Client saying the Search, and the Advanced Search on the website are no longer working, always showing 0 RESULT, though in the backend the search functionality is working fine,

I searched a lot of places and different sites with NOTHING to even explain the issue, no ERROR LOG, no Notification even from the backend!

I would much appreciated if any one can give me a glimpse for what should be done here or at least where to begin.

Thanks in advance!


Solution

  • One way to test the frontend search functionality of Interspire Shopping Cart is to run this test in your browser:

    http://www.example.com/search.php?search_query=test

    The search.php file is responsible for handling the query. Append a query string to the end of the search.php file as in the example above (?search_query=test). Use a few different queries, such as a few of the product names that you know exist in the store.

    If you get no results, you may want to look at the template file that handles the rendering of the search form, located in /templates/your_theme/Panels/HeaderSearch.html.

    If your custom theme is having issues with the search, you can remove that file and the Master template will take over which is pulled from /templates/_master/Panels/HeaderSearch.html

    The default code in 6.1.8 version os ISC should look like the following (verify):

                <div id="SearchForm">
                <form action="%%GLOBAL_ShopPath%%/search.php" method="get" onsubmit="return check_small_search_form()">
                    <label for="search_query">%%LNG_Search%%</label>
                    <input type="text" name="search_query" id="search_query" class="Textbox" value="%%GLOBAL_OriginalSearchQuery%%" />
                    <input type="image" src="%%GLOBAL_IMG_PATH%%/%%GLOBAL_SiteColor%%/Search.gif" class="Button" />
                </form>
                <p>
                    <a href="%%GLOBAL_ShopPathNormal%%/search.php?mode=advanced"><strong>%%LNG_AdvancedSearch%%</strong></a> |
                    <a href="%%GLOBAL_ShopPathNormal%%/search.php?action=Tips">%%LNG_SearchTips%%</a>
                </p>
            </div>
    
            <script type="text/javascript">
                var QuickSearchAlignment = 'left';
                var QuickSearchWidth = '232px';
                lang.EmptySmallSearch = "%%LNG_EmptySmallSearch%%";
            </script>
    

    You'll notice the form action submits to the search.php page, so if your search.php page is returning results and you're still getting no results from your form then you will want to inspect the rendered code (inspect element / view source) and verify the rendered code looks correct such as the following:

    <form action="http://www.example.com/search.php" method="get" onsubmit="return check_small_search_form()">
    

    If all looks correct, then you may want to inspect your javascript. These are some troubleshooting ideas that should get you headed in the right direction for debugging the frontend search functionality of Interspire Shopping Cart.

    If all that fails, you will want to take a look at the database. Specifically, the table that handles search data is located in the 'isc_product_search' table.