Inhalte aufrufen

Profilbild

Customize the category product list return


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

#1 CompleteCoders

CompleteCoders

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 103 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
  • 3799 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.

Marcus Gesing

Smartstore AG