Created
August 30, 2016 04:19
-
-
Save asmagin/e5347eaaa7cea566b20281bd4b5871ef to your computer and use it in GitHub Desktop.
Sitecore Catalog Module for Habitat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// An action to manage data for the ProductList | |
/// </summary> | |
/// <param name="pageNumber">The page number.</param> | |
/// <param name="facetValues">The facet values.</param> | |
/// <param name="sortField">The sort field.</param> | |
/// <param name="sortDirection">The sort direction.</param> | |
/// <returns> | |
/// The view that represents the ProductList | |
/// </returns> | |
public ActionResult MultipleProductLists( | |
[Bind(Prefix = StorefrontConstants.QueryStrings.Paging)] int? pageNumber, | |
[Bind(Prefix = StorefrontConstants.QueryStrings.Facets)] string facetValues, | |
[Bind(Prefix = StorefrontConstants.QueryStrings.Sort)] string sortField, | |
[Bind(Prefix = StorefrontConstants.QueryStrings.SortDirection)] CommerceConstants.SortDirection? sortDirection) | |
{ | |
var productSearchOptions = new CommerceSearchOptions | |
{ | |
NumberOfItemsToReturn = StorefrontConstants.Settings.DefaultItemsPerPage, | |
StartPageIndex = 0, | |
SortField = sortField | |
}; | |
var currentRendering = RenderingContext.Current.Rendering; | |
var datasource = currentRendering.Item; | |
var viewModel = _catalogRepository.GetMultipleProductList(datasource, currentRendering, productSearchOptions); | |
return View("ProductRecommendation", viewModel); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment