ProductSearch
Extends Search. ProductSearch replaces the default Search algorithm with a more specific Product search.
Methods |
---|
exclude(Mixed:products)
ProductSearch
Excludes one or more products from the ProductSearch.results. The excluded
|
excludeId(Number|String:id)
ProductSearch
Excludes a single Product from the search results using its ID supplied as either a Number or a String |
excludeIds(Number[]|String[]:ids)
ProductSearch
Excludes one or more Products from the search results using an Array or Product IDs - each supplied as either a Number or a String. |
featured(Boolean isFeatured = true)
ProductSearch
Find products that have been marked as featured. Supplying |
inCategories(Array:categories [, Boolean:recursive = false])
ProductSearch
Find products within one or more Category objects either recursively within the categories or directly within the category. Defaults to a non-recursive search. |
orderBy(String:order)
ProductSearch
Sets the order and direction of the search. The available order strings for this algorithm are:
|
withIds(Array:ids)
ProductSearch
Restrict results to one or more known Product IDs - each supplied as either a Number or a String. |
withManufacturer(String:name)
ProductSearch
Find products from a single manufacturer by name. Also accepts a Manufacturer object. |
withManufacturers(String[]:names)
ProductSearch
Find products from one or more manufacturers by name. |
withManufacturerId(Number:id)
ProductSearch
Find products from a single manufacturer by their system ID represented as a Number. |
withManufacturerIds(Number[]:id)
ProductSearch
Find products from one or more manufacturers by their system IDs represented as a Number. |
withManufacturerRange(String:range)
ProductSearch
Find products with a matching manufacturer range. |
withManufacturerRanges(String[]:ranges)
ProductSearch
Find products with one or more matching manufacturer ranges. |
withPartNumbers(String[]:partNumbers)
ProductSearch
Find products by one or more manufacturer part numebrs. Note, this is not the same as by SKU (see |
withQuickfindCodes(String[]:codes)
ProductSearch
Find products by one or more Evance quickfind code reference numbers. |
withSkus(String[]:skus)
ProductSearch
Find products by one or more SKU reference strings. |
withSpecValueIds(Number[]:ids)
ProductSearch
Find products associated with one or more Specification Value IDs. |
How to use
ProductSearch is not instantiated automatically. You can create a new instance of ProductSearch anywhere within a layout, page or included partial.
<?ev
var productSearch = new ProductSearch();
productSearch.withManufacturer('Sony').limit(10).orderBy('price:asc');
for (var result of productSearch) {
// do something
}
?>