Shopify themes, liquid, logos, and UX
How can I enable in stock filter by default in Impact theme?
I assumed the code below handles the liquid code for the in stock filer
{%- if filter.param_name == 'filter.v.availability' -%}
<label for="{{ id_prefix }}-{{ filter.param_name }}" class="bold">{{- 'collection.faceting.availability_label' | t -}}</label>
<input id="{{ id_prefix }}-{{ filter.param_name }}" type="checkbox" class="switch instock" name="{{ filter.param_name }}" value="1" {% if filter.active_values.size > 0 %}checked{% endif %}>
{%- else -%}
<label for="{{ id_prefix }}-{{ filter.param_name }}" class="bold">{{- filter.label -}}</label>
<input id="{{ id_prefix }}-{{ filter.param_name }}" type="checkbox" class="switch" name="{{ filter.param_name }}" value="1" {% if filter.true_value.active %}checked{% endif %}>
{%- endif -%}
Hi @Kel06
This is David at SalesHunterThemes.
To check and add the function, it require to update theme code.
In this case I think you should contact with theme supporter, they will help you check and update the code.
We create fast Shopify themes, focusing on exceptional performance and seamless experience across all devices.
Try our Electro theme Free! (Now at Black Friday price)
Hi @Kel06
Just remove the if statement the first input so it will be checked. Assuming that is the right code
{%- if filter.param_name == 'filter.v.availability' -%}
<label for="{{ id_prefix }}-{{ filter.param_name }}" class="bold">{{- 'collection.faceting.availability_label' | t -}}</label>
<input id="{{ id_prefix }}-{{ filter.param_name }}" type="checkbox" class="switch instock" name="{{ filter.param_name }}" value="1" checked>
{%- else -%}
<label for="{{ id_prefix }}-{{ filter.param_name }}" class="bold">{{- filter.label -}}</label>
<input id="{{ id_prefix }}-{{ filter.param_name }}" type="checkbox" class="switch" name="{{ filter.param_name }}" value="1" {% if filter.true_value.active %}checked{% endif %}>
{%- endif -%}
For Shopify 2.0 Free themes, you can follow the instructions below.
NOTE: There will be multiple code like this in the same file.
{% if value.active or value.value == '1' %}
checked
{% endif %}
Code should look like this:
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
Awesome, the facets.liquid tweak solved it for me 😀
Thank you for your help!
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025