Developer forum

Forum » Development » Ability to set TotalProductCount

Ability to set TotalProductCount

Vincent Gercke
Reply

Hi
Is it possible to set the TotalProductCount property in the OnBeforeProductList observer? In the OnBeforeProductList observer we are fetching data from a third party system to filter and sort products (Relewise) and that works as intended by using the AutoIds property to determine which products to show.
But the TotalProductCount is wrong and I can't see that it is possible to overrule the value, when looking through the source code:

TotalProductCount not mathing with the amount of Products shown due to the override of AutoIds in OnBeforeProductList observer.

I don't see how I can overrule the settings variable using the observer pattern:


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

i See the issue.

Below is the code where the count comes from - and it will not take your modification of autoids into consideration - also this notification is before the one you are using.

So we either needs to change the above code to use autoids.count and you can use the above notification subscriber or you should change your customisation.

Can you create a query macro that is used to limit the product scope of your search? Guessing you are doing recommendations?

BR Nicolai

Votes for this answer: 1
 
Vincent Gercke
Reply

Thank you for the reply! I need to have a discussion with the customer because, we have ran into some issues since they use both DW and Relewise to filter products at the same time and it can get quite messy. My suggestion will be to use DW for filtering and then use Relewise to sort the results. If they can accept this solution, the TotalProductCount won't be an issue since it will match the results :-)

 

You must be logged in to post in the forum