Close

Commenting out the subcategories section of the page gives me an "Loading the Page Failed"

Vlad Starr
7 months ago
#15049 Quote
Avatar
  • 4
There appears to be a bug where Prisma doesn't seem to properly support alternate category templates.  I duplicated the Themes\Prisma\Views\Catalog\CategoryTemplate.ProductsInGridOrLines.cshtml and renamed it to  Themes\Prisma\Views\Catalog\CategoryTemplates.ProductsInGridOrLinesNoSubcategory.cshtml.  I also commented out the subcategory code in the new template and assigned it to my categories in NopCommerce.  

On the first page load, I don't see the subcategories as I expect, but when try to page over to the next page, I get the message "Loading the Page Failed."  NopCommerce's error log entry shows:

The model item passed into the ViewDataDictionary is of type 'SevenSpikes.Nop.Plugins.AjaxFilters.Models.ProductsModel', but this ViewDataDictionary instance requires a model item of type 'Nop.Web.Models.Catalog.CategoryModel'.

The following is also logged:

The view 'CategoryTemplate.ProductsInGridOrLinesNoSubcategory' was not found. The following locations were searched:
....

I suspect the pager isn't cooperating with NopCommerce's paging mechanism.  Is there a way to fix this problem, or does selectable category templates not supported?



hristian.dimov
6 months ago
#15055 Quote
Avatar
  • Moderator
  • 386
Vlad Starr wrote:
There appears to be a bug where Prisma doesn't seem to properly support alternate category templates.  I duplicated the Themes\Prisma\Views\Catalog\CategoryTemplate.ProductsInGridOrLines.cshtml and renamed it to  Themes\Prisma\Views\Catalog\CategoryTemplates.ProductsInGridOrLinesNoSubcategory.cshtml.  I also commented out the subcategory code in the new template and assigned it to my categories in NopCommerce.  

On the first page load, I don't see the subcategories as I expect, but when try to page over to the next page, I get the message "Loading the Page Failed."  NopCommerce's error log entry shows:

The model item passed into the ViewDataDictionary is of type 'SevenSpikes.Nop.Plugins.AjaxFilters.Models.ProductsModel', but this ViewDataDictionary instance requires a model item of type 'Nop.Web.Models.Catalog.CategoryModel'.

The following is also logged:

The view 'CategoryTemplate.ProductsInGridOrLinesNoSubcategory' was not found. The following locations were searched:
....

I suspect the pager isn't cooperating with NopCommerce's paging mechanism.  Is there a way to fix this problem, or does selectable category templates not supported?





Hi,

It looks like that the Ajax Filters plugin does not find the new template. Please follow the documentation of how to add new category templates: https://www.nop-templates.com/ajax-filters-plugin-for-nopcommerce-documentation#addcategorytemplate

Hope this helps!
Regards,
Hristian Dimov
Nop-Templates.com