Developer forum

Forum » Development » Prepare StockLevelProvider

Prepare StockLevelProvider

Duncan Janssen

For the live products prices, there is a prepare Prices function. You also get a list of the selection products where I can get the ProductIds from, for example, a product overview.

We need to have something similar for our client but then for the stock levels. I use the StockLevelProvider to change the values of the stockLevels.

Is there something similar for the stockLevelProvider to get a selection of the products?


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

Hi Duncan

There is no similar approach as prepareprices.

But you have other options.

If you use product catalog for viewmodels, you can use a notification subscriber:


It will give you this argument:


It contains a list of all the product autoids that is about to get rendered, and then you can get the products using product service (products are already cached)

Then query the inventory from ERP in one go for all the products and store the response information in a threadstatic, request.items or memory cache and use that cache in your stocklevel provider to retrieve the value for each product.

BR Nicolai

Votes for this answer: 2
Duncan Janssen

Hi Nicolai,

Thanks for the answer. We now use the notification subscriber to get a list of all rendered products.

Whit kind regards,



You must be logged in to post in the forum