Using exp:store:search I'm trying to get a list of results and order them in price order, and by this I mean the price an item sells for rather then the just the regular price as 9 out of 10 items are on a permanent sale price and to the customer it will just seem a bit confusing and sloppy.

The documentation says:

If the orderby parameter is set to “price”, Store will order your products based on their regular price. Note that this won’t take into account any currently applicable sale price.

It doesn't say how you can do it or even whether it's at all feasible. I'd have though it would be a pretty common requirement for people. How can I sort by the sale price? Cheers!

1 Answer 1


It's not easy to order by the sale price. That is because Store gathers a list of products and orders them (using SQL) before it decides whether a sale price is applicable. To order products by sale price would mean calculating which products are on sale and their currently applicable price in a SQL query, before ordering them.

Question: why are 9/10 items on a permanent sale price? That's not exactly what the sale price field was designed for.

If you need some sort of "Suggested Retail Price" which you will display crossed out next to the real price to make customers feel like they are getting a fantastic bargain, it would be better to add another custom field to your channel to use for that and use the Store price field for the actual price you are selling at.

  • The site I am building is for one selling musical instruments, it's pretty much standard practice (as it is in a lot of main retail sectors) to sell at a reduced price, so essentially things are always on sale. I get what you're saying about the purpose of the sale price field and that an RRP is better placed in a custom field though that doesn't seem to solve the overriding problem. If someone is selling something on sale and the customer filters by price, that item won't be included in that range and would be extremely frustrating if they think you've been hiding sale items away.
    – Leonard
    May 13, 2013 at 10:21
  • I agree, it's not ideal. Unfortunately it's a difficult problem to solve (especially in future once we add sale pricing per member group), because for performance reasons we cannot order/filter the products in PHP. In any case, we will try to take this into account in future. In the meantime though, an RRP custom field is probably the way to go. May 20, 2013 at 21:39
  • Thanks for getting back to me Adrian. Could you add to your wish list the option to perhaps filter by sale price as it's own attribute so if people choose to take this option over performance they can? If somethings on sale it's often give a good deal for profile or shift stock, both which get looked over if they're not appearing in listings. It's the only problem I have with a so far perfect system, I'm sure I can't be alone!
    – Leonard
    May 21, 2013 at 10:55
  • Yes, will definitely look into it for the next release :) May 22, 2013 at 9:38
  • Just wondering, is there any word on this? Couldn't see any mentions of it in any of the updates.
    – Leonard
    Nov 13, 2013 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.