I'd like to make an improvement to how I'm displaying related products on a product detail page. Right now, the list of related products will...

  • be limited to the same type and category (Playa relationships)
  • be ordered by dollar value in descending order (numeric field)

Sometimes the price alone can make an item dissimilar; for example a $1.5M gum production machine isn't relevant on the detail page for a $0.75 pack of gum. What I'd like to do is limit my related entries to anything within ${x} of the current item.

Here's the (simplified) related products template, to which I pass the IDs of related category pages:

<h3>Related Products</h3>
{exp:playa:parents entry_id="{embed:category_ids}" orderby="product_price" sort="desc"}
     <li><a href="{page_uri}">{title}</a>, ${product_price}</li>

If I wanted to limit by date, I could use EE's start_on parameter. If I wanted to match a specific value, I know I could use the search paramater. In this case, I simply want to add WHERE product_price <= x, with x being a dollar amount I've already calculated in PHP to be reasonably close to the currently-viewed product. Is there a way to accomplish this without going straight for the query module?

2 Answers 2


Have a look at Low Search -- it can be used as a replacement for the Channel Entries tag, and has a range parameter which might suit your needs.

  • Thanks Derek! We're conveniently using Low Search on the site, and I didn't even realize it has a range parameter and can work with native or Playa relationships. Perfect!
    – Matt Stein
    Jun 13, 2013 at 22:50

Since I love answering my own questions, here's the template embed I ended up with thanks to Derek's suggestion of using Low Search:


$pad = 10; // dollar amount above the current price at which we'll cap results
$price_limit = intval('{embed:current_product_price}')+$pad; 


{exp:low_search:results child:product_categories="{embed:category_ids}" range:product_price=";<?php echo $price_limit; ?>" orderby="product_price" sort="desc" parse="inward"}
    <li><a href="{page_uri}">{title}</a>, ${product_price}</li>

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.