1

I'm trying to replicate one of those "Order By" options that you see in eCommerce websites with Low Search.

The options usually are:

  • Most Popular
  • Newest
  • Price - High to Low
  • Price - Low to High

I've worked out I could do something like:

<select name="orderby">
    <option value="">Most Popular</option>
    <option value="date">Newest</option>
    <option value="matrix:price">Price - High to Low</option>
</select>

But I'm struggling to understand how (Or if possible) to add the Price options in there along with a sorting option.

Also - the prices are set inside a Matrix field, so is it possible to order by using a Matrix field.

It would be good if you could combine the Order By and Sort parameters in EE, without needing to do 2 seperate selects.

1 Answer 1

2

It's not possible to order by a column in a Matrix field. Just imagine how that's supposed to work: if a Matrix field has multiple rows (and therefore multiple prices), which price should be used for ordering? It doesn't really make sense.

If you want to order by price, there should be a dedicated field that contains the price by which you can sort and order.

It would be good if you could combine the Order By and Sort parameters in EE, without needing to do 2 separate selects.

This is possible with Low Search, using the orderby_sort parameter, eg: orderby_sort="date|desc" or orderby_sort="title|asc"

1
  • Thanks Low! When you put it like that, it does make sense. I did have a single price field, but I removed it wondering if I could just do this within a matrix (That was setting the price as well) The orderby_sort parameter is ace. Will give that a go.
    – Jason Mayo
    Jun 1, 2015 at 17:11

Your Answer

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

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