Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to implement sorting of a list of products. I have a product list in the form List
productList.OrderBy(x => x.SalePrice)
productList.OrderBy(x => x.Price)
However without creating classes for my products with calculated parameters. Is there a simple way to sort this by the "effective" Price. So that if it's not on sale it uses the normal price, if it is on sale it uses the Sale Price?
Please let me know if this is available.. Otherwise I would very much like to see this included (or could even add it myself on GitHub?)
There is nothing in the Core to do that at the moment, but that's a really good idea.
It would be a simple extension method to write:
public static decimal EffectivePrice(this IProductContent product)
return product.OnSale ? product.SalePrice : product.Price;
Yes, This solves it nicely, thanks for the quick assistance. I'm loving Merchello.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted