- Theme Engine
- Design Principles
- Templates
- EVML Reference
- Output
- Comments
- Operators
- Statements and Declarations
- Built-in Functions
- Built-in Objects
- Account
- Address
- Array
- Boolean
- Branch
- Cart
- CartLine
- Category
- CategoryCollection
- CategoryFilter
- CategoryFilterCollection
- CategoryFilterOption
- CategorySearch
- Collection
- Color
- Contact
- Currency
- Date
- Discount
- Dom
- Event
- EventCollection
- EventSlot
- Image
- Layout
- Locale
- Money
- Number
- Object
- Page
- PageCollection
- PageSearch
- PageSharer
- Pagination
- Postage
- Price
- PriceDiscount
- Product
- ProductCollection
- ProductCustomisation
- ProductDownload
- ProductMedia
- ProductMediaFrame
- ProductPrice
- ProductSearch
- ProductSpecification
- ProductSpecificationValue
- ProductVariation
- ProductVariationOption
- RecentlyViewed
- RegExp
- Request
- Review
- ReviewCollection
- Search
- SearchCollection
- SearchResult
- String
- Tag
- Template
- Url
- Website
- EV Tags
- CSS Pre-processor
- Ajax API
ProductSearch
Extends Search. ProductSearch replaces the default Search algorithm with a more specific Product search.
Methods | |
---|---|
exclude(Mixed:products) |
Excludes one or more products from the ProductSearch.results. The excluded products may be supplied as an Array, ProductCollection of Product objects, or an individual Product object. Returns the original Search object allowing for method chaining. |
featured() |
Find products that have been marked as featured. Returns the original Search object allowing for method chaining. |
inCategories(Array:categories [, Boolean:recursive]) |
Find products within one or more Category objects either recursively within the categories or directly within the category. The default is False - non-recursive search. 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:
Returns the original Search object allowing for method chaining. |
withManufacturer(String:name) |
Find products with a manufacturer name. Returns the original Search object allowing for method chaining. |
withManufacturerRange(String:name, String:range) |
Find products with a matching manufacturer and range. Returns the original Search object allowing for method chaining. |
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.results){
// do something
}
?>