Is there a way to display all the filter options even if there are no such products?

Is there a way to display all the filter options even if there are no such products?

Sometimes it is necessary to show all possible filters inside the navigation bar even if there are no product matching results. Default Magento allows showing all filter options, and to apply this logic the following setting should be set to Filterable (no results) in Stores → Product Attribute → select the attribute → Edit → Storefront Properties → Use in Layered Navigation.



On the frontend, filters with no results will be displayed in the layered navigation, but customers won't be able to pick them: 



Vise versa, if you'd like to hide filters that don't have matching products, you need to set the Use in Layered Navigation setting to Filterable (with results).