Building on from this question How can I filter Craft Commerce products by price
I have a price filter in the store
Using this code works fine for the normal price
{% set queryParams = {
relatedTo: category,
defaultPrice: [
'and',
'>= ' ~ 0,
'<= ' ~ 90,
]
}
%}
but defaultPrice does not consider sale prices.
So if a product is normally $99 but it is reduced to $89, it won't be returned
I would have expected defaultPrice to store the current price being charged. So the sale price if it was on sale.
Is it possible to filter by price and include sale prices?
I've spent hours now on something I thought would be simple. It seems the only way to get this information is to get the products and loop through them. Checking for sale prices.
Do I have to create a plugin to make a usable price filter?