Developer forum

Forum » Rapido » Don't show products with zero price

Don't show products with zero price

Gaëtan Di Caro
Reply

Hello,

 

I'm having a bit of a dilemma here. In my (B2B) rapido solution, the products don't have base prices, only user-specific prices. I should not show the user products on which they don't have a price.

The "Products" query in the repository is configured to only filter products with a price > 0. That looks fine, except the data that is indexed is the base price, therefore no product is returned. If I remove this condition, then every product is returned, including those without a price. Since the products come from the index, they are not affected by the setting "only return products which have a price". I can't edit the template for the feed either because I only get a fixed amount of products in it, so the page size would be different and the product count wrong.

 

What can I do here that doesn't require the use of assortments ?


Replies

 
Nicolai Pedersen
Reply

That setting would not work with paging even when not using the index. It is a unresolvable problem. Say you have a searhc result with potentially 10000 products - would you calculate the price and filter them out? It would never work.

You just have to make another approach usin different wording on the paging to indicate that the page numbers are guidance only - showing almost correct search result and just let people know that there (might) be more in the result...

Also, it is impossible to do facets on the price under these conditions.

BR Nicolai

 
Gaëtan Di Caro
Reply

Alright, I tried with assortments but I can't get them to work... Is Rapido compatible with assortments out of the box ?

I enable the assortments on the front end, created some which link a specific product to specific users, built them, rebuilt the indexes, etc. but I keep seeing the product with a user that is not on the assortment... Any idea ?

 
Nicolai Pedersen
Reply
This post has been marked as an answer

You need to add a parameter to the search as well.

See dump

Capture.PNG
Votes for this answer: 1
 
Gaëtan Di Caro
Reply

Worked, thanks !

 

You must be logged in to post in the forum