Quantcast
Channel: Using Optimizely Platforms
Viewing all articles
Browse latest Browse all 8020

Sort By Price on Product Variation using Find Query

$
0
0

Hi all!

We are using Catelog Product Model to search products and already had Sort by options with DisplayName and Relavance.

Now we would like to sort the results with Price(Asc & Dsc) wich is with variation. In our case We have developed query with  Catelog Product Model, 

So until we get the results of query we are not going to get the price of variation.

If anyone achieved this scenario please help us to break it.

Here is some code snippet:

query = query.OrderByDescending(p => p.DisplayName); //Used to sort with Display Name. P->Product  Model

We tried with 

query = query.OrderByDescending(p => p.GetProductPrice()); which is not effecting the results, because of not having price here.

var results = query
.ApplyBestBets()
.Skip((page - 1) * pageSize)
.Take(pageSize)
.Track()
.GetContentResult();

Thank you!


Viewing all articles
Browse latest Browse all 8020

Trending Articles