Inhalte aufrufen


Customize the category product list return

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
1 Antwort zu diesem Thema

#1 CompleteCoders


    Advanced Member

  • Members
  • 78 Beiträge

Geschrieben: 25 May 2018 - 04:19

We need to add some special code to filter out what products are returned when a category is rendered.  We can see in the code where SS builds the query to return the list of products.  Is there a way for us to hook into that so we can edit the query before it goes to the server?  We really don't want to edit the core code.

  • RidgeOi und Brantot gefällt das

#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3388 Beiträge

Geschrieben: 25 May 2018 - 08:47

You can use an action filter to filter the execution of CatalogController.Category and get to the view model CategoryModel. It has the property SearchResult with the search hits of the relevant category. Here is an example filter that shows this using for the product detail page as an example. Registration of the filter is here.

Schöne Grüße aus Düsseldorf,
Marcus Gesing