Jump to content

Edit History

MikelMR

MikelMR


The module has a new version

Hi,

I would like to know what is the best place to override the behaviour of the renderFacets with the new FacetedSearch module (Tried 3.1.0 and 3.2.0).

With the 2.0.3 version I have overridden the ProductListingFrontController->renderFacets, but with the new version it seems that there is no call to that method and it's done in the facetedsearch module, SearchProvider->renderFacets.

What I'm doing is to group some facets, so I need to access to the facetCollection before the module renders it and I would prefer not to modify the Prestashop Core or the facetedsearch module.

The closest hooks I have found were after the render call, hookFilterProductSearch and hookActionProductSearchAfter, so I can't use them.

I have managed to do it by modifying the ProductSearchResult, but I have read that as that class has a namespace it can't be overridden, moreover, I have read that you have to avoid to override classes and this is going to be deprecated.

Any idea/suggestion on how can I do it properly?

Regards,

MikelMR

MikelMR

Hi,

I would like to know what is the best place to override the behaviour of the renderFacets with the new FacetedSearch module (Tried 3.1.0 and 3.2.0).

With the 2.0.3 version I have overridden the ProductListingFrontController->renderFacets, but with the new version it seems that there is no call to that method and it's done in the facetedsearch module, SearchProvider->renderFacets.

What I'm doing is to group some facets, so I need to access to the facetCollection before the module renders it and I would prefer not to modify the Prestashop Core or the facetedsearch module.

The closest hooks I have found were after the render call, hookFilterProductSearch and hookActionProductSearchAfter, so I can't use them.

I have managed to do it by modifying the ProductSearchResult, but I have read that as that class has a namespace it can't be overridden, moreover, I have read that you have to avoid to override classes and this is going to be deprecated.

Any idea/suggestion on how can I do it properly?

Regards,

MikelMR

MikelMR

Hi,

I would like to know what is the best place to override the behaviour of the renderFacets with the new FacetedSearch module.

With the 2.0.3 version I have overridden the ProductListingFrontController->renderFacets, but with the new version it seems that there is no call to that method and it's done in the facetedsearch module, SearchProvider->renderFacets.

What I'm doing is to group some facets, so I need to access to the facetCollection before the module renders it and I would prefer not to modify the Prestashop Core or the facetedsearch module.

The closest hooks I have found were after the render call, hookFilterProductSearch and hookActionProductSearchAfter, so I can't use them.

I have managed to do it by modifying the ProductSearchResult, but I have read that as that class has a namespace it can't be overridden, moreover, I have read that you have to avoid to override classes and this is going to be deprecated.

Any idea/suggestion on how can I do it properly?

Regards,

×
×
  • Create New...