> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supercycle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Availability filter wording

> Show the availability filter as a single Available option instead of Yes and No

> [!NOTE]
>
> This snippet changes how your theme shows the [availability filter](https://docs.supercycle.com/developers/guides/availability-filter.md). Set up the filter first. The code below is for Horizon-based themes, such as Horizon and Fabric. Other themes need the same two changes where they list filter values and where they show active filters.

Search & Discovery shows a true or false filter as two options, Yes and No. These edits hide No and label Yes as Available, both in the filter list and in the active filter shown after a customer selects it.

***

## Filter list

In `snippets/list-filter.liquid`, add this at the start of the loop over `filter.values`:

```liquid snippets/list-filter.liquid theme={null}
{%- for value in filter.values -%}
  {%- liquid
    assign value_label = value.label
    if filter.param_name == 'filter.v.m.supercycle.future_availability_inventory'
      assign raw_value = value.value | append: ''
      if raw_value == '0' or raw_value == 'false'
        continue
      endif
      assign value_label = 'Available'
    endif
  -%}
```

In the same loop, pass `value_label` to the checkbox instead of `value.label`:

```liquid snippets/list-filter.liquid theme={null}
{% render 'checkbox',
  name: value.param_name,
  value: value.value,
  label: value_label,
```

Where the snippet prints the selected value next to the filter name, add a branch for the availability filter:

```liquid snippets/list-filter.liquid theme={null}
if filter_style == 'horizontal' and active_value_count == 1 and filter.param_name == 'filter.v.m.supercycle.future_availability_inventory'
  echo 'Available'
elsif filter_style == 'horizontal' and active_value_count == 1
  echo filter.active_values[0].label
```

***

## Active filters

In `snippets/filter-remove-buttons.liquid`, show Available on the button that removes the filter:

```liquid snippets/filter-remove-buttons.liquid theme={null}
{% if filter.param_name == 'filter.v.m.supercycle.future_availability_inventory' %}
  Available
{% elsif filter.type == 'boolean' or show_filter_label %}
  {{ filter.label | escape }}: {{ value.label | escape }}
{% else %}
  {{ value.label | escape }}
{% endif %}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.