protected virtual SearchViewModel <NodeContent> GetSearchModel(NodeContent currentContent, int pageSize) { return(_viewModelFactory.Create(currentContent, new FilterOptionViewModel { FacetGroups = new List <FacetGroupOption>(), Page = 1, PageSize = pageSize })); }
public ViewResult Index(FashionNode currentContent, FilterOptionViewModel viewModel) { var model = _viewModelFactory.Create(currentContent, viewModel); if (HttpContext.Request.HttpMethod == "GET") { var response = _recommendationService.SendCategoryTracking(HttpContext, currentContent); model.Recommendations = response.GetCategoryRecommendations(_referenceConverter); } return(View(model)); }
public async Task <ViewResult> Index(FashionNode currentContent, FilterOptionViewModel viewModel) { var model = _viewModelFactory.Create(currentContent, viewModel); if (HttpContext.Request.HttpMethod == "GET") { var trackingResult = await _recommendationService.TrackCategory(HttpContext, currentContent); model.Recommendations = trackingResult.GetCategoryRecommendations(_referenceConverter); } return(View(model)); }
public ActionResult Index(SearchPage currentPage, FilterOptionViewModel filterOptions) { var viewModel = _viewModelFactory.Create(currentPage, filterOptions); if (filterOptions.Page <= 1) { viewModel.Recommendations = _recommendationService .SendSearchTracking(HttpContext, filterOptions.Q, viewModel.ProductViewModels.Select(x => x.Code)) .GetSearchResultRecommendations(_referenceConverter); } return(View(viewModel)); }
public async Task <ActionResult> Index(SearchPage currentPage, FilterOptionViewModel filterOptions) { var viewModel = _viewModelFactory.Create(currentPage, filterOptions); if (filterOptions.Page <= 1) { var trackingResult = await _recommendationService.TrackSearch(HttpContext, filterOptions.Q, viewModel.ProductViewModels.Select(x => x.Code)); viewModel.Recommendations = trackingResult.GetSearchResultRecommendations(_referenceConverter); } return(View(viewModel)); }
public ActionResult Index(SearchPage currentPage, FilterOptionViewModel filterOptions) { var viewModel = _viewModelFactory.Create(currentPage, filterOptions); if (filterOptions.Page <= 1 && HttpContext.Request.HttpMethod == "GET") { HttpContext.Items[SearchTrackingData.TotalSearchResultsKey] = filterOptions.TotalCount; viewModel.Recommendations = _recommendationService .SendSearchTracking(HttpContext, filterOptions.Q, viewModel.ProductViewModels.Select(x => x.Code)) .GetSearchResultRecommendations(_referenceConverter); } return(View(viewModel)); }
public async Task <ViewResult> Index(FashionNode currentContent, FilterOptionViewModel viewModel) { //vinhph Test //var results = SearchClient.Instance.Search<VariationContent>().FilterOnCurrentMarket().GetContentResult(); //var result = SearchClient.Instance.Search<VariationContent>().Filter(x => x.DefaultPrice().UnitPrice.LessThan(new Money(2000000000, SiteContext.Current.Currency))).GetContentResult(); var model = _viewModelFactory.Create(currentContent, viewModel); if (HttpContext.Request.HttpMethod == "GET") { var trackingResult = await _recommendationService.TrackCategoryAsync(HttpContext, currentContent); model.Recommendations = trackingResult.GetCategoryRecommendations(_referenceConverter); } return(View(model)); }
public ViewResult Index(FashionNode currentContent, FilterOptionViewModel viewModel) { var model = _viewModelFactory.Create(currentContent, viewModel); return(View(model)); }
public ActionResult Index(SearchPage currentPage, FilterOptionFormModel formModel) { var model = _viewModelFactory.Create(currentPage, formModel); return(View(model)); }
public ActionResult Index(SearchPage currentPage, FilterOptionViewModel filterOptions) { var viewModel = _viewModelFactory.Create(currentPage, filterOptions); return(View(viewModel)); }
public ActionResult Index(FashionNode currentContent, FilterOptionFormModel formModel) { var model = _viewModelFactory.Create(currentContent, formModel); return(Request.IsAjaxRequest() ? PartialView(model) : (ActionResult)View(model)); }