SOLVED: Products element when "On Sale" enabled shows all products if no products are actually marked as on sale

Bricks Version: 1.5.7

I noticed today that if I use the Products element and set it to show only “On Sale” products, in the event that there are no products on sale it instead shows all products.

At the very least, I’d expect it to return no results in that scenario rather than every single product. Ideally though it’d also allow for customization of an error message to display when there is a situation where no products are on sale.

In my situation, I have a WooCommerce site with 770 products I am building. I tried to add a Products element for an On Sale category on the homepage and realized it was showing all 770 items instead. Then I realized it was doing that because I actually had 0 products with a sale price at the time, and once I added a sale price then it worked as expected. This led me to realize though that this On Sale filter in the Products element is not working as expected in the scenario where no products are actually on sale.

Hi Dustin,
Thanks so much for your report!

Unfortunately, I cannot reproduce the issue. Having no “sale” products shows this message:

No products were found matching your selection.

Best regards,
timmse

That’s unfortunately not my experience. :frowning: I only get that “no products were found matching your selection” if I choose “Featured” for example (since no products are Featured either). But when it comes to Sale, it shows everything when no products are actually marked as on sale. Once I set a sale price though then it will show properly.

Here’s a few screenshots of how the query is setup in case this helps at all. Or if you still can’t reproduce then I can offer remote access to it for further troubleshooting.


Notice the screenshot above shows the total results of 770 products which is 100% of the products in the website as opposed to just on-sale products (where I currently have 0 on-sale products).

That’s probably a good idea :slight_smile:

Hey Dustin,
We have found the issue and fixed it in your installation :v:

We’ll include the fix with Bricks 1.6.

Best regards,
timmse

1 Like

That’s perfect. Thank you kindly. Eager for 1.6 final release. :slight_smile:

Out of curiosity, what was the issue / root cause on this one?

Hey Dustin,
Bricks 1.6 (Beta 2) contains a fix for this problem.
I can’t tell you the cause, but the main thing is, that it’s fixed :smiley:

You can download it manually in your account:
https://bricksbuilder.io/account/?v=1.6-beta2

Best regards,
timmse

2 Likes

Confirmed defect seems fixed in 1.6 beta 2.

Thanks for solving this defect. :slight_smile: