A space to discuss online store customization, theme development, and Liquid templating.
Hi guys,
I'm using the storefront filtering on Prestige 2.0, and I would like to hide the elements with no products (= 0) on the filters (on Collection Page).
For exemple, in this case, if I select "In stock", I would like to hide automatically "Out of stock" as there are no products available.
Then, if I unselect "In stock", I would the "Out of stock" back again (if there is a more than 1 product corresponding).
I don't know if someone already does it and have some code to share ? 🙂
Thanks a lot!
That is an advanced customization,
Just because a road is closed doesn't mean you have to remove the asphalt , at some point people need to still know what the possible path is BEFORE they need it.
Though yes if such a thing is unusable the argument is only available options should be viewable and unavailable options it shouldn't be seen at all .
Deleting/hiding an option may be against the themes design intent of informational permanency overview awareness versus removing|truncating information; you don't want to keep customers unaware of options they may be able to change too regardless if the current set of filters means that option isn't usable (note how I do not say the option is irrelevant).
Irrelevant options would be say a gender filter when the entire collection is women, or color for a collection of products that only ever come in 1 color.
The other thing displaying disabled choices can do is help highlight options that are selected by contrast; when not using things like checkbox toggles.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
If it's a 2.0 template, I just added a single line in the base.css file.
.facet-checkbox--disabled {display:none!important;}