CategorySearch

Extends Search. CategorySearch replaces the default Search algorithm with a more specific product category search. Currently the CategorySearch object has limited functionality.

Methods
featured()

Filter search results to only include featured categories.

Returns the original Search object allowing for method chaining.

orderBy(String:order)

Sets the order and direction of the search. The available order strings for this algorithm are:

  • created:asc
  • created:desc
  • featured:asc
  • featured:desc
  • modified:asc
  • modified:desc
  • sequence:asc
  • sequence:desc
  • title:asc
  • title:desc

Returns the original Search object allowing for method chaining.



How to use

CategorySearch is not instantiated automatically. You can create a new instance of CategorySearch anywhere within a layout, page or included partial. 


<?ev
    var categorySearch = new CategorySearch;
    categorySearch.featured().limit(10);
    for(var category of categorySearch.results){
        // do something
    }
?>