Developer forum

Forum » Ecommerce - Standard features » Only show products that are in stock

Only show products that are in stock

Thomas Schroll
Reply

Hi

In Management Center -> eCommerce -> Advanced Configuration -> General there is an option "Only show products that are in stock". If I tick it, the products with zero stock still show up in the frontend.

Does anybody know if I need to check something in my template to avoid  showing zero stock products or should dw remove the products automatically?

Regards Thomas


Replies

 
Dmitriy Benyuk
Reply

Hi Thomas,
The products of type "Service" are always shown even if they have zero stock, you could check maybe you are seeing them.
On the frontend there is a tag called "Ecom:Product.Stock" which output the product stock, you can add an "IF" condition with it to hide the products(here is the "IF" usage)
Regards Dmitrij

 
Thomas Schroll
Reply

Thanks Dmitriy.

None of my products are services. It is no problem for me to check in the template, I was just curious to know more about the functionality of the setting.

Regards Thomas

 
Thomas Schroll
Reply

Also it is not only a question about not showing the products with zero stock. The Ecom:ProductList.PageProdCnt tag shows the number of products on page, and this value will show all products, not only the products with stock.

Regards Thomas

 
Nicolai Høeg Pedersen
Reply

Hi Thomas

Dynamicweb should not show the products - also it makes a check in the cart so you do not check them out.

It could be variants  - or data error. If you have a product, and it is a 'master', and that master have a number of variants that are in stock, the product will show up.

Can you provide us with a link?
Nicolai

 
Thomas Schroll
Reply

Hi Nicolai

I have updated the index and now it is working fine. Do I need to update the index every the stock change?

The solution is latienda.net.dynamicweb-cms.com

Regards Thomas

 
Nicolai Høeg Pedersen
Reply

Hi Thomas

You can activate "Optimized product retrieval" on the paragraph settings of the catalog module. That would make the index return auto ids and let the catalog logic query the products and have this feature working as well without updating the index.

Nicolai

 
Thomas Schroll
Reply

Hi Nicolai

Thanks, I will do that.

Regards Thomas

 

You must be logged in to post in the forum