on 2018 Aug 01 10:56 AM
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Go to the product and set the stock status as 'forceInStock' from backoffice. So always those products will be available.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.