Max Price filtering bug when using Tiers instead of Price

Hey,

In my use-case, I’ve used the snippets to make the Price field unrequired and hidden (unset), while also making the Tiers field enabled/required. However, when I perform a search, in the filters section, the price range slider option only uses the first tier option from a listing as the max price range for the entire listing. Even, if the other tiers have a higher price.

E.g.

This listing has 2 tiers:

Something nice - 50
Something better - 100

I search and see the above listing’s view block.

The filter for the max price range only shows: (min) 0 - 50 (max)

I think this should be enough information to recreate the bug, but just let me know if you need any more details.

Cheers,
Chris :victory_hand:

Hi,

Thanks for the bug report. We will fix it in future updates.

1 Like

Hey,

I just wondered if you would be able to provide a temporary fix for this until it’s able to make it into a proper release?

Cheers,
Chris :victory_hand:

Hi Chris,

After a brief review, there’s unfortunately no simple temporary fix for this, as it would require modifying the number range calculation logic in the HivePress core:
hivepress/includes/components/class-attribute.php at master · hivepress/hivepress · GitHub Calculating the range values based on tiers is more complex in this case because tiers are stored within an array rather than a separate meta value (like price).

As a possible workaround, you can manually change the max price to a static large number to cover the possible listing tiers Change price filter min and max value - #5 by ihor

Hope this helps.

1 Like

Hi Ihor,

Thanks for taking the time to look into this - I really appreciate it!

That makes sense given how the range is calculated, especially with tier options stored as an array rather than a simple value.

The workaround you suggested seems to be working fine for now, so I’ll just go with that.

Thanks again for your help!

Cheers,
Chris :victory_hand:

1 Like