Title: Get available filters programmatically
Last modified: January 18, 2022

---

# Get available filters programmatically

 *  [mvereijken](https://wordpress.org/support/users/mvereijken/)
 * (@mvereijken)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/get-available-filters-programmatically/)
 * We would like to enhance our product archive page in a way that shows all available
   filters directly instead of one button that opens up the modal that displays 
   all filters. This means that we need to have filter buttons in the horizontal
   bar that link to the right element within the filter modal.
 * Since this means that the filter is split into two different sections and I can’t
   show a filter twice on one page I need to find a way to programatically get the
   availaible filters so I can build the filter buttons myself. Does the plugin 
   include a function that returns all the available/shown filters? If that’s not
   the case, Could you suggest an alternative method?
 * Thanks in advance!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fget-available-filters-programmatically%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Dmytro Holovnia](https://wordpress.org/support/users/dholovnia/)
 * (@dholovnia)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/get-available-filters-programmatically/#post-15266965)
 * Hello,
 * Sorry but I do not understand this part “This means that we need to have filter
   buttons in the horizontal bar that link to the right element within the filter
   modal.”. Do you have a mock-up of what you need?
 * Regards,
    Dima
 *  Thread Starter [mvereijken](https://wordpress.org/support/users/mvereijken/)
 * (@mvereijken)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/get-available-filters-programmatically/#post-15271785)
 * Hi Dima,
 * An interactive prototype of what we want to achieve can be found at [https://xd.adobe.com/view/3fdfc1ef-6bd1-408e-89e8-ee4207447c4b-6a8c/?fullscreen](https://xd.adobe.com/view/3fdfc1ef-6bd1-408e-89e8-ee4207447c4b-6a8c/?fullscreen)
 * If you compare it to [https://duux.com/en/store](https://duux.com/en/store) you’ll
   notice the way the filters can be reached is changed by showing all filter options
   instead of one global filters button.
 * This is the part I need help with since these buttons need to be dynamic based
   on if the filter is shown for the current results.
 * I hope this makes sense to you, but don’t hesitate to ask any more questions!
 *  Plugin Author [Dmytro Holovnia](https://wordpress.org/support/users/dholovnia/)
 * (@dholovnia)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/get-available-filters-programmatically/#post-15271932)
 * I cannot access this site [https://duux.com/en/store](https://duux.com/en/store).
   I see only “Your access to this site has been limited by the site owner”
 * Do you mean something like this [https://woocommerce-products-filter.berocket.com/product-category/chocolates/](https://woocommerce-products-filter.berocket.com/product-category/chocolates/)?
 *  Thread Starter [mvereijken](https://wordpress.org/support/users/mvereijken/)
 * (@mvereijken)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/get-available-filters-programmatically/#post-15272068)
 * That’s very strange. Maybe you can access [https://duux.com/store/](https://duux.com/store/)(
   the Dutch version of the webshop)
 * The way the filters need to be shown indeed looks like your example but we don’t
   want a dropdown to appear for each filter but want the filter options to be shown
   in one global off-canvas modal.
 * If you click on one of the rounded gray buttons (that say ‘Kleur’, ‘Prijs’ or‘
   Ruimte’) on [https://xd.adobe.com/view/3fdfc1ef-6bd1-408e-89e8-ee4207447c4b-6a8c/?fullscreen](https://xd.adobe.com/view/3fdfc1ef-6bd1-408e-89e8-ee4207447c4b-6a8c/?fullscreen)
   you’ll understand what I mean.
 *  Plugin Author [Dmytro Holovnia](https://wordpress.org/support/users/dholovnia/)
 * (@dholovnia)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/get-available-filters-programmatically/#post-15272115)
 * ok, I see what you mean.
    We don’t have such option. You can do this with custom
   coding. Just add needed buttons and attach to them event to open a sidebar.
 *  Thread Starter [mvereijken](https://wordpress.org/support/users/mvereijken/)
 * (@mvereijken)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/get-available-filters-programmatically/#post-15272142)
 * I’m aware that I can add this with custom coding but I don’t want to add these
   buttons hardcoded. This would mean that the buttons are always shown. Since the
   filter options in the sidebar will disappear if the filter is not available for
   the current selection this will result in a bad user experience.
 * That’s why I need to dynamically get the available filters as soon as a user 
   loads the page or updates the filter settings. I could use javascript to check
   which options are shown in the sidebar but this doesn’t feel like the right approach.
   That’s why I’m hoping to use one of your functions/filters to dynamically get
   the available filters.
 *  Plugin Author [Dmytro Holovnia](https://wordpress.org/support/users/dholovnia/)
 * (@dholovnia)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/get-available-filters-programmatically/#post-15286173)
 * This buttons can be added with Javascript. This way you will know what filters
   are on the page, how much values per filter selected etc.
 * Regards,
    Dima

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Get available filters programmatically’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-ajax-filters/assets/icon-256x256.gif?rev=2770304)
 * [Advanced AJAX Product Filters](https://wordpress.org/plugins/woocommerce-ajax-filters/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-ajax-filters/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-ajax-filters/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-ajax-filters/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-ajax-filters/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-ajax-filters/reviews/)

## Tags

 * [programmatically](https://wordpress.org/support/topic-tag/programmatically/)

 * 7 replies
 * 2 participants
 * Last reply from: [Dmytro Holovnia](https://wordpress.org/support/users/dholovnia/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/get-available-filters-programmatically/#post-15286173)
 * Status: not resolved