Developer forum

Forum » Development » Custom product sorting

Custom product sorting

Bjarne Rosendal
Reply

Hi there
 

I have a site which has been using a custom product sorting successfully - up until now...

The custom sorting works by a notification subscriber class that looks like this:
 


 

Trouble is the part in red. The sorting works fine on the first productlist page, but the Products property always return the products that should be rendered on the page and not total amount of products on the page (which is the collection I am looking for to do the custom sorting based on product fields). I have looked in all 3 notifications, BeforeRender, BeforeSort and BeforePaging but the property is the same.
 

Is there another way to obtain the collection of products on the page?
 

Best regards
Bjarne Rosendal


Replies

 
Mikkel Høst
Reply

Hi Bjarne.

In the Product catalog there is a fairly new setting called something like "Optimize product" (in the bottom of the settings) - I think this will affect your NotificatonSubscriber. Disable it and see what happens

 
Bjarne Rosendal
Reply

Hi Mikkel

It worked like a charm, thanks alot! :)

 

You must be logged in to post in the forum