SearchPageViewModel

Overview

The SearchPageViewModel is the primary model used to render the search results view and it's partial views to customers. This article will help you understand what's available to you in the view model.

Requirements

The following pre-requisites will be necessary to accomplish the goals of this article:

  • General understanding of template engines
  • Understanding HTML, CSS, JavaScript
  • Familiarity with template languages
  • Familiarity with ASP.NET MVC Razor

Getting Started

There are no tasks needed to get started with understanding this object. 

SearchPageViewModel

The SearchPageViewModel object will contain all of the details for a specific search made in your Hotcakes Commerce store.

Members

The following table gives you details on the various members of the SearchPageViewModel object.  The descriptions are based on default functionality and the default Viewset included with Hotcakes.

Member Type Description
Categories List<FacetItem> Contains a collection of categories that the products returned are assigned to.
CurrentRouteValues RouteValueDictionary This property has all of the values that are used in the URL so that the URL can be shared with others and still get the same search results.
LocalCategory Category This value will be null and is not used.
Manufacturers List<FacetItem> Contains a collection of manufacturers that the products returned are assigned to.  This is used to populate the facet controls that customers will be used to refine the search results and change the route values.  (We realize that this property is misspelled, and we'll fix that in a future release.)
MaxPrice Decimal This value will be the highest price found in the collection of products returned in the search results.  It is used to set the end price for the price slider.
MinPrice Decimal This value will be the lowest price found in the collection of products returned in the search results.  It is used to set the start price for the price slider.
PagerData PagerViewModel If the search results have more than a single page of results, this property will contain useful details to help render the paging feature in the search results view.
Products List<SingleProductViewModel> Contains a collection of products found that match the search made by the customer.  This collection is used to populate all of the search facets.
Properties List<PropertyFacetItem> Contains a collection of product type properties that are assigned to the products returned in the search results.  This is used to populate the facet controls that customers will be used to refine the search results and change the route values.
SelectedCategories List<SelectedFacetItem> If a customer selects one or more categories in the faceted filter controls, they will be found in this property.
SelectedManufacturers List<SelectedFacetItem> If a customer selects one or more manufacturers in the faceted filter controls, they will be found in this property.  (We realize that this property is misspelled, and we'll fix that in a future release.)
SelectedMaxPrice Decimal If a customer changes the maximum price in the faceted filter controls, it will be found in this property.
SelectedMinPrice Decimal If a customer changes the minimum price in the faceted filter controls, it will be found in this property.
SelectedProperties List<SelectedFacetItem> If a customer selects one or more product type properties in the faceted filter controls, they will be found in this property.
SelectedTypes List<SelectedFacetItem> If a customer selects one or more product types in the faceted filter controls, they will be found in this property.
SelectedVendors List<SelectedFacetItem> If a customer selects one or more vendors in the faceted filter controls, they will be found in this property.
ShowManufactures Bool This property will be true if the module setting is changed to show manufacturers in the search results facet filtering area.  Otherwise, it will be false as default.
ShowVendors Bool This property will be true if the module setting is changed to show vendors in the search results facet filtering area.  Otherwise, it will be false as default.
SortSelectList List<SelectListItem> This property is not currently used.
SubCategories List<SingleCategoryViewModel> This property is not currently used.
Types List<FacetItem> Contains a collection of product types that the products returned are assigned to.  This is used to populate the facet controls that customers will be used to refine the search results and change the route values.
Vendors List<FacetItem> Contains a collection of vendors that the products returned are assigned to.  This is used to populate the facet controls that customers will be used to refine the search results and change the route values.

 

Have more questions? Submit a request

Need More Help?

Do you need more assistance with this article? Please review your support options.