cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

I do not want hero product stock finished in the top list in hybris 6.7,How I can do?

Former Member

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Natively, there's no setting solution. You need to customize a bit this feature. Otherwise, you could remove product with no stock from catalog by creating flexible search indexation that exclude the no stock product.

Answers (4)

Answers (4)

Former Member
0 Kudos

If you are calling heroProductFacade.getHeroProductsForCategory(String categoryCode)

you can do solrHeroProductDef.getProducts().stream().map(stockLevels -> product.getStockLevels()).stream().sorted(Comparator.comparing(StockLevelModel::getAvailable()))

Note: the code might have compilation errors The idea is to sort the list of products based on StockLevelModel.getAvailable()

vinay_malempati
Active Participant
0 Kudos

You can add one property in solr to have the stock value, sort by Stock value descending by default so that you see the out of stock products at last, if you want this to happen only for out of stock products to be at last, then in the new solr field you can just put 1 if it is in stock and 0 if it is out stock and do the sorting. Hope this should work for you.

Former Member
0 Kudos

Hero product marked as a product comes first in the page. But if you do not have stock, it should be at the end of the page like any other non-stocked product.How we can do?

VinayKumarS
Active Contributor
0 Kudos

Go to the product and set the stock status as 'forceInStock' from backoffice. So always those products will be available.