Santosh
Santosh

Reputation: 419

BigCommerce API to Search products

We are trying to build a mobile app for a Big Commerce based shop. We want to implement a simple product search feature - User will enter a search keyword, application should display all the products which matches that search keyword.

There don't seem to be any straight forward Big Commerce API to achieve this. Product has a field named "search_keywords" but surprisingly this is not listed in possible filters for querying a list of products. Can some body throw some light on how to implement a simple search feature using BC APIs.

Upvotes: 1

Views: 1903

Answers (2)

Cody O'Dell
Cody O'Dell

Reputation: 191

Bigcommerce themes have a feature called QuickSearch that allows for fetching n XML list of matched products (and content pages) via AJAX but you will come across cross-origin domain issues if your server is not configured correctly. One example would be:

        $.ajax({
            type: 'GET',
            dataType: 'xml',
            url: config.ShopPath + '/search.php?action=AjaxSearch&search_query='+encodeURIComponent($('#search_query').val()),
            success: function(response) { QuickSearch.search_done(response); }
        });

Upvotes: 2

Saran
Saran

Reputation: 713

Search keywords is used for web store search, it is not surfaced via API. If you want to build an entire search solution via API, it is going to be hard unless you GET the products and cache it. Check out an app called searchspring from BC app store, which implements an faceted search. Cheers!

Upvotes: 1

Related Questions