I'm attempting to add the Nop Ajax Filters to a category page. I followed all the steps in the documentation and the filters display correctly and look very nice. However, I'm getting a message box "Loading the page failed." when clicking on any of the filters.
I only have the "Enable Specifications Filter" and "Include Products From Subcategories checked in the settings.
I'm attempting to add the Nop Ajax Filters to a category page. I followed all the steps in the documentation and the filters display correctly and look very nice. However, I'm getting a message box "Loading the page failed." when clicking on any of the filters.
I only have the "Enable Specifications Filter" and "Include Products From Subcategories checked in the settings.
I'm using the trial version of 2.8.
What am I missing here?
Thanks in advance!
Mike
Hi Mike,
Please send us an email with a link to your web site, so that we can take a look.
Currently, I'm working on my local machine using Visual Studios 2012. I'm working on a website redesign for a client and would like to demo the Ajax Filter to them.
Currently, I'm working on my local machine using Visual Studios 2012. I'm working on a website redesign for a client and would like to demo the Ajax Filter to them.
Will attaching the "view source" help?
In that case please reproduce the problem again and then check you Log and tell us the error following these steps.
The model item passed into the dictionary is of type 'SevenSpikes.Nop.AjaxFilters.Models.ProductsModel', but this dictionary requires a model item of type 'Nop.Web.Models.Catalog.CategoryModel'.
The details for the log entry.Full message:
System.InvalidOperationException: The model item passed into the dictionary is of type 'SevenSpikes.Nop.AjaxFilters.Models.ProductsModel', but this dictionary requires a model item of type 'Nop.Web.Models.Catalog.CategoryModel'. at System.Web.Mvc.ViewDataDictionary`1.SetModel(Object value) at System.Web.Mvc.ViewDataDictionary..ctor(ViewDataDictionary dictionary) at System.Web.Mvc.WebViewPage`1.SetViewData(ViewDataDictionary viewData) at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.<BeginInvokeAction>b__20() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<>c__DisplayClass1d.<BeginExecut
The model item passed into the dictionary is of type 'SevenSpikes.Nop.AjaxFilters.Models.ProductsModel', but this dictionary requires a model item of type 'Nop.Web.Models.Catalog.CategoryModel'.
Hi mstuart,
It looks like there is a mismatch in the files. Please delete the whole AjaxFilters plugin folder and upload it again.
It looks like there is a mismatch in the files. Please delete the whole AjaxFilters plugin folder and upload it again. Thanks
Ok, I deleted the AjaxFilters plugin folder and copied it over again. This did not fix the issue.
Do I need to download another version?
Some additional information....
I have the custom widget for the AjaxFilters placed in /Views/Shared/_ColumnsThree.cshtml (in the right column)
_ColumnsThree.cshtml is being referenced by /Views/Catalog/CategoryTemplate.ProductsInGridOrLines.cshtml
Yes, you can download the package again just in case. The templates shouldn't be a problem. Do you have a custom theme or you are using the DefaultClean theme? Please note that after selecting any of the filtering options the Ajax Filters return a view from here: Plugins\SevenSpikes.Nop.AjaxFilters\Views\Catalog7Spikes\CategoryTemplate.ProductsInGridOrLines.cshtml
It is a partial view with the filtered products on which is passed a ProductsModel but the error says that a Category model is expected, which means that the wrong view is used maybe the default category template for some reason. Please modify you Global.asax file by adding a few empty spaces in it and save it.
Yes, you can download the package again just in case. The templates shouldn't be a problem. Do you have a custom theme or you are using the DefaultClean theme? Please note that after selecting any of the filtering options the Ajax Filters return a view from here: Plugins\SevenSpikes.Nop.AjaxFilters\Views\Catalog7Spikes\CategoryTemplate.ProductsInGridOrLines.cshtml
It is a partial view with the filtered products on which is passed a ProductsModel but the error says that a Category model is expected, which means that the wrong view is used maybe the default category template for some reason. Please modify you Global.asax file by adding a few empty spaces in it and save it.
Thanks
Yes, I'm working on a new custom theme. I copied the Default theme renamed it and have been adding to as needed.
So...
1) I just took a fresh copy of nopCommerce...and pointed it to my DB. I installed the AjaxFilters again and now I no longer receive the error message. So there is definitely something wrong with my new theme in relation to the AjaxFilters. Not sure what the issue here is as my changes have all been minor HTML/CSS type edits.... I'm not sure how to proceed with this.
2) The above mentioned test raised another issue. When I click on one of the filter items, as I said, there is no longer an error message, but the issue now is it only displays the paging buttons below the sub categories. No products. Does it matter if the category page that the Ajaxfilters are on has only sub categories, no products itself?