Close

Bring back specification attributes in to Category Template

nopowl
10 years ago
#3205 Quote
Avatar
  • 3
Hi I'm trying to bring back the specification attributes list for each product in the same query as the product information when using AjaxFilters

I know the category template is making use of @model SevenSpikes.Nop.AjaxFilters.Models.ProductsModel

I've done some digging and seen that the AjaxFilters plugin is using it's own stored proc.

In CatalogController.cs there's a method called PrepareProductOverviewModels with a param labelled prepareSpecificationAttributes with a default value of false.

I'm just wondering if it's possible to hook in and set that to true for the inital load of the products and also when the filters run.. I'm trying to use the attributes in a table the customer is viewing.

thanks,
Tom
Boyko
10 years ago
#3212 Quote
Avatar
  • Moderator
  • 1570
nopowl wrote:
Hi I'm trying to bring back the specification attributes list for each product in the same query as the product information when using AjaxFilters

I know the category template is making use of @model SevenSpikes.Nop.AjaxFilters.Models.ProductsModel

I've done some digging and seen that the AjaxFilters plugin is using it's own stored proc.

In CatalogController.cs there's a method called PrepareProductOverviewModels with a param labelled prepareSpecificationAttributes with a default value of false.

I'm just wondering if it's possible to hook in and set that to true for the inital load of the products and also when the filters run.. I'm trying to use the attributes in a table the customer is viewing.

thanks,
Tom


Hi Tom,

As you don't have the source code of the Ajax Filters you can simply specify the specification parameter to true instead of false. But the Ajax Filters controller inherits from the nopCommerce CatalogController and uses the protected PrepareProductOverviewModels method. So you can simply modify the code in this method in the catalog controller to always prepare the specifications regardless of the prepareSpecificationAttributes parameter.

Hope this information is useful!

Thanks
Regards,
Nop-Templates.com Team