public override object GetModel(On404SearchWidget widget)
        {
            var path = _request.Url.AbsolutePath;

            IPagedList <Product> searchProducts = _productSearchIndexService.SearchProducts(new ProductSearchQuery
            {
                SearchTerm = GetSearchTerm(path),
                PageSize   = widget.MaxProductsToShow,
                Page       = 1
            });

            return(new On404SearchWidgetModel
            {
                Text = widget.Text,
                Products = searchProducts.GetCardModels()
            });
        }
 public PartialViewResult ResultsInternal(ProductSearchQuery query)
 {
     ViewData["query"] = query;
     ViewData["cart"]  = _cart;
     return(PartialView("Results", _productSearchIndexService.SearchProducts(query)));
 }
Beispiel #3
0
 public ActionResult Results([IoCModelBinder(typeof(ProductSearchQueryModelBinder))] ProductSearchQuery query)
 {
     ViewData["query"] = query;
     ViewData["cart"]  = _cart;
     return(PartialView("Results", _productSearchIndexService.SearchProducts(query)));
 }