Close

Nop Ajax Filters Not Working show a pop up box with message :-Loading the page failed

pvinit
10 years ago
#3827 Quote
Avatar
  • 27
Hi,
order Id:- 8872

When i Try To use Nop.Ajax.Filters It's Not Working And Error Message occured with Popup Box;

Message was :- Loading the page failed

i have customize a Catalog Controller. i have Add a new parameter in  " ProductOverviewModel " Method. Was it the reasion of errorr? and tell how to fix it.?

And Here The Log Detail Which is In Admin Side:-

Log level:   Error

Short message:  Method not found: 'System.Collections.Generic.IEnumerable`1<Nop.Web.Models.Catalog.ProductOverviewModel> Nop.Web.Controllers.CatalogController.PrepareProductOverviewModels(System.Collections.Generic.IEnumerable`1<Nop.Core.Domain.Catalog.Product>, Boolean, Boolean, System.Nullable`1<Int32>, Boolean, Boolean)'.

Full message: - System.MissingMethodException: Method not found: 'System.Collections.Generic.IEnumerable`1<Nop.Web.Models.Catalog.ProductOverviewModel> Nop.Web.Controllers.CatalogController.PrepareProductOverviewModels(System.Collections.Generic.IEnumerable`1<Nop.Core.Domain.Catalog.Product>, Boolean, Boolean, System.Nullable`1<Int32>, Boolean, Boolean)'. at SevenSpikes.Nop.AjaxFilters.Controllers.Catalog7SpikesController.(Int32 , Int32 , PriceRangeFilterModel7Spikes , SpecificationFilterModel7Spikes , AttributeFilterModel7Spikes , ManufacturerFilterModel7Spikes , CatalogPagingFilteringModel , String  , Boolean  , String&  ) at SevenSpikes.Nop.AjaxFilters.Controllers.Catalog7SpikesController.GetFilteredProducts(Int32 categoryId, Int32 manufacturerId, PriceRangeFilterModel7Spikes priceRangeFilterModel7Spikes, SpecificationFilterModel7Spikes specificationFiltersModel7Spikes, AttributeFilterModel7Spikes attributeFiltersModel7Spikes, ManufacturerFilterModel7Spikes manufacturerFiltersModel7Spikes, CatalogPagingFilteringModel pagingFilteringModel, String queryString, Boolean shouldNotStartFromFirstPage) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeActionMethodWithF
Support
10 years ago
#3830 Quote
Avatar
  • Moderator
  • 1044
Hi PVINIT,

Please note that all our products are guaranteed to work only for the official nopCommerce release and not custom builds.

I see that you have added a new parameter and that is why the Nop Ajax Filters throw an error as they rely on this method. Even if you make the parameter to be an optional, this will not work as this is a breaking change.

One possible solution is to create your own method that accepts the new parameter, within this method call the unmodified PrepareProductOverviewModels function and then execute your custom logic. Thus both the Nop Ajax Filters and your custom logic will work.

Hope that helps!
pvinit
10 years ago
#3836 Quote
Avatar
  • 27
Hi
Thank You For Reply,

As you said :- " One possible solution is to create your own method that accepts the new parameter, within this method call the unmodified PrepareProductOverviewModels function and then execute your custom logic. Thus both the Nop Ajax Filters and your custom logic will work. "

Can You Give me An Example for This So i can Implement it.

Regards.
Support
10 years ago
#3838 Quote
Avatar
  • Moderator
  • 1044
pvinit wrote:
Hi
Thank You For Reply,

As you said :- " One possible solution is to create your own method that accepts the new parameter, within this method call the unmodified PrepareProductOverviewModels function and then execute your custom logic. Thus both the Nop Ajax Filters and your custom logic will work. "

Can You Give me An Example for This So i can Implement it.

Regards.


Hi,

For example create your own method MyPrepareProductOverviewModels(IEnumerable<Product> products, bool preparePriceModel = true, bool preparePictureModel = true, int? productThumbPictureSize = null, bool prepareSpecificationAttributes = false,
            bool forceRedirectionAfterAddingToCart = false, your new parameter)
{
var productModels = PrepareProductOverviewModels(products,preparePriceModel, preparePictureModel,  productThumbPictureSize, prepareSpecificationAttributes ,
            bool forceRedirectionAfterAddingToCart );


foreach(var model in ProductsModel)
{
  execute your custom logic on the product modelusing your new parameter.
}
}

Hope that helps!
pvinit
10 years ago
#3850 Quote
Avatar
  • 27
Hi,

Thank You For Reply,

It's Works Now.

Can You Help me to Do This:--

On Ajax filter, with displaying dropdown for filters, i don't want to display filter title.. but want to display title in the dropdown inplace where you are displaying 'All' under jDropdown. Can you please advise how to do this.

Moreover, instead of open a dropdown on click, I want to open it on mouse over. Pls advise how to do this.


Thank You Again,

Regards,
PVinit


pvinit
10 years ago
#3857 Quote
Avatar
  • 27
Hi All,
I am Waiting For your response.

Regards  
Boyko
10 years ago
#3863 Quote
Avatar
  • 1570
pvinit wrote:

On Ajax filter, with displaying dropdown for filters, i don't want to display filter title.. but want to display title in the dropdown inplace where you are displaying 'All' under jDropdown. Can you please advise how to do this.


You have all the Razor view files of the Ajax Filters open to modification, so you can change it to your needs.
Simply modify these files below and instead of showing the resource "All" use the filterGroup name.

SevenSpikes.Nop.Plugins.AjaxFilters\Views\AttributeFilter7Spikes\AttributeFilter.cshtml
SevenSpikes.Nop.Plugins.AjaxFilters\Views\SpecificationFilter7Spikes\SpecificationFilter.cshtml
SevenSpikes.Nop.Plugins.AjaxFilters\Views\ManufacturerFilter7Spikes\ManufacturerFilter.cshtml

For example for the attribute filters change this:

<li class="selected">
                                <a class="allFilterDropDownOptions">@T("SevenSpikes.NopAjaxFilters.Client.Common.All")</a>
                            </li>


with this:

<li class="selected">
                                <a class="allFilterDropDownOptions">@attributeFilterGroup.Name</a>
                            </li>



The same changes need to be done in the other 2 views for the Specifications and Manufacturers respectively.

pvinit wrote:

Moreover, instead of open a dropdown on click, I want to open it on mouse over. Pls advise how to do this.


The Ajax Filters use jDropDown jquery library. I am not sure if it supports hover rather than click for dropdown. You can find the library here - http://do-web.com/jdropdown/overview.

Best Regards,
Nop-Templates.com Team
Regards,
Nop-Templates.com Team
pvinit
10 years ago
#3869 Quote
Avatar
  • 27
Hi,
Thank You For Reply

I change View Files As You say but it,s not Working and Show An Error , on
SevenSpikes.Nop.Plugins.AjaxFilters\Views\SpecificationFilter7Spikes\SpecificationFilter.cshtml
SevenSpikes.Nop.Plugins.AjaxFilters\Views\ManufacturerFilter7Spikes\ManufacturerFilter.cshtml
Files And It,s Only Work On
SevenSpikes.Nop.Plugins.AjaxFilters\Views\AttributeFilter7Spikes\AttributeFilter.cshtml

Error Message: -

System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.Web.HttpCompileException (0x80004005): c:\Users\Developer\Documents\Projects\Harry\310\Presentation\Nop.Web\Plugins\SevenSpikes.Nop.AjaxFilters\Views\ManufacturerFilter7Spikes\ManufacturerFilter.cshtml(77): error CS0103: The name 'attributeFilterGroup' does not exist in the current context at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.GetObjectFactory(String virtualPath, Boolean throwIfNotFound) at Nop.Web.Framework.Themes.ThemeableBuildManagerViewEngine.FileExists(ControllerContext controllerContext, String virtualPath) in c:\Users\Developer\Documents\Projects\Harry\310\Presentation\Nop.Web.Framework\Themes\ThemeableBuildManagerViewEngine .cs:line 10 at Nop.Web.Framework.Themes.ThemeableVirtualPathProviderViewEngine.GetPathFromGeneralName(ControllerContext controllerContext, List`1 locations, String name, String controllerName, String areaName, String theme, String cacheKey, String[]& searchedLocations) in c:\Users\Developer\Documents\Projects\Harry\310\Presentation\Nop.Web.Framework\Themes\ThemeableVirtualPathProviderViewEngine.cs:line 113 at Nop.Web.Framework.Themes.ThemeableVirtualPathProviderViewEngine.GetPath(ControllerContext controllerContext, String[] locations, String[] areaLocations, String locationsPropertyName, String name, String controllerName, String theme, String cacheKeyPrefix, Boolean useCache, Boolean mobile, String[]& searchedLocations) in c:\Users\Developer\Documents\Projects\Harry\310\Presentation\Nop.Web.Framework\Themes\ThemeableVirtualPathProviderViewEngine.cs:line 79 at Nop.Web.Framework.Themes.ThemeableVirtualPathProviderViewEngine.FindThemeablePartialView(ControllerContext controllerContext, String partialViewName, Boolean useCache, Boolean mobile) in c:\Users\Developer\Documents\Projects\Harry\310\Presentation\Nop.Web.Framework\Themes\ThemeableVirtualPathProviderViewEngine.cs:line 231 at Nop.Web.Framework.Themes.ThemeableVirtualPathProviderViewEngine.FindPartialView(ControllerContext controllerContext, String partialViewName, Boolean useCache) in c:\Users\Developer\Documents\Projects\Harry\310\Presentation\Nop.Web.Framework\Themes\ThemeableVirtualPathProviderViewEngine.cs:line 274 at SevenSpikes.Nop.Framework.ViewEngines.ViewEngine7Spikes.FindPartialView(ControllerContext controllerContext, String partialViewN
pvinit
10 years ago
#3873 Quote
Avatar
  • 27
Hi

I am Still Waiting for reply for my last post and i also tell me that how to show a filtered attribute with (Remove) link on page. it's possible or not?

Please Reply

Regards,
Pvinit
Support
10 years ago
#3874 Quote
Avatar
  • Moderator
  • 1044
Hi,

For the attributes, you should use the @attributeFilterGroup.Name
For the specifications, you should use the @specificationFilterGroup.Name
For the manufacturers, you should leave it as it is, because the manufacturers are just a collection of all manufacturers, so you cannot group them by a property for example.

Hope that helps!