Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

Sort by Price not in correct order

Vote:
 

Hi!

My goal is to sort products on my category pages by price. I'm using the default Order By method in the SearchService of the Episerver Foundation repository to sort products by price when loading a list of products in a category, but it's not sorted in correct order.

On the category page, products are not sorted in correct order, which by default is in ascending order.

This should've sorted as follows: $400.00, $280.00, $540.00.

I've read  the DefaultPrice method extended from EntryContentBase which gets and sorts it by UnitPrice.Amount but it seems this doesn't work.

An exception is thrown when I inspect the order value on immediate window:

Does the latest version of Find support sorting for decimal type (in reference to a question here: https://world.episerver.com/forum/developer-forum/Search/Thread-Container/2016/5/orderby-price-commerce-results/) or what are possible workarounds for correctly sorting by price?

I have updated to the latest versions of Find:

Episerver.Find v.13.4.4

Episerver.Find.Commerce v11.2.0

Episerver.Find.Cms v.13.4.4

#258482
Edited, Jul 05, 2021 15:44
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.