Understanding filtering of perch_categories()

  • Hi,

    I'm using Perch (not Runway) and I have multiple categories setup to filter products in the Perch Shop.

    I have the following as a category template:

    1. <perch:category id="catTitle" type="smarttext" label="Age" required="true" />
    2. <perch:category id="catSlug" type="slug" for="catTitle" suppress="true" />
    3. <perch:category id="min" type="number" suppress="true" required label="Age Minimum"/>
    4. <perch:category id="max" type="number" suppress="true" required label="Age Maximum"/>

    I have the following code to filter the categories based on a given age (I'm just testing at this point so its been simplified):

    1. $age = perch_layout_var('age', true);
    2. $availableAgeCategories = perch_categories([
    3. 'skip-template' => true,
    4. 'set' => 'ages',
    5. 'filter' => 'min',
    6. 'match' => 'lte',
    7. 'value' => $age
    8. ]);

    If I remove the filter I get the full list of age categories as I would expect (as you can see there is at least 1 category that should be returned that has a min age of 6:

    But with the filter I get zero results:

    Not too sure what I'm doing wrong here, i'm sure its stupidly simple on my part.

    Any help ?