I am trying to display only the products that are on sale using the following code but instead of only displaying the one product I have on sale, it is displaying all my products. Please can someone tell me what is wrong with my code.

I am testing using Expression Engine 2.7.1 and Expresso Store 2.0.6

{exp:store:search channel="products" search:on_sale="yes" }



2 Answers 2


The search:on_sale="yes" parameter hasn't been implemented in Store 2 yet, due to the complexity of the new global sales functionality.

To mimic this behaviour you should be able to use the on_sale conditional like so:

{exp:store:search channel="products"}
    {if product_details:on_sale}
        <!-- product details -->

This parameter will be added back in the next version of Store 2.

  • Does this mean ALL products are fetched from the database then filtered? So if you have 100,000 products they all get fetched then the ones on sale get filtered using PHP? There could be quite a performance issue with large databases. Commented Nov 19, 2013 at 19:55
  • Yes, although 100,000 is really an edge case :) We had to do some extra work to make this happen in a memory-efficient way (due to the complexity of the new sale options), which is why this didn't make the 2.0 release. However, it's finished now and will be included in the next release. Commented Nov 19, 2013 at 21:05
  • I know :) I dont have that many but someone might! I have this issue with Brilliant Retail, it does the same for Featured products, it bugs me, so looking forward to the next release. Commented Nov 20, 2013 at 8:19

The Store tag needs to go inside a Channel entries tag, something like this...

{exp:channel:entries channel="products"}
  {if on_sale}
  Price: <del>{regular_price}</del> <ins>{price}</ins>!
  • The search tag acts a wrapper for the channel entries tag and you should not use it nested inside of a regular channel entries tag because it will provide weird results unless you were going to use an embedded template which could very easily become a huge performance hit if you have more then a few products on each page load. Commented Nov 17, 2013 at 9:40

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.