WooCommerce Products Meta Data Filters Wordpress Plugin - Rating, Reviews, Demo & Download
Plugin Description
WooCommerce Products Meta Data Filters is a simple but powerful WordPress plugin to filter your WooCommerce products
Filter by product weight, product length, product width, product height, product custom fields, product ACF fields and much more!
The filtering will only work on WooCommerce pages (main WooCommerce shop page, archive product lists) etc. It will not function on custom product lists added to custom pages eg. via a 3rd party plugin or via shortcodes.
Watch the video demo on YouTube
Features
- No complicated settings page. Simple and easy administration via Widgets.
- Works out of the box.
- Auto discovers all default and custom meta keys.
- You can create unlimited product filters and combine them.
- Extensible / developer friendly. You can alter the plugin without hacking it, but via WordPress filters and actions.
- Works on all WooCommerce setups and themes.
- Easily translatable via .po / .mo files.
Requirements
- WordPress 4.0+
- WooCommerce 3.0+
- PHP 5.4+
Usage
On wp-admin, click on Appearance on the left menu and then on the Widgets submenu. Locate the “Filter products by Meta” widget and add it on the appropriate sidebar
On the widget options fill in the fields depending on your needs
Options
- Title: Enter the title of the widget. Most of the times it is placed on the top of the widget as a header.
- Label: Put the label of the element you are filtering eg. “Width:”
- Meta Key: Select the meta key you want to filter by
- Filter type: Select “List” to display all available values of this meta key or “range” to create a slider if you are filtering by a numeric value, eg. the weight of the products
- Order options: Select the order of the filter’s values
- Order Autorefresh: This will remove the submit button from a “range” filter and will auto submit the filter when it has been changed
- You are ready to go! * Save *
For Developers
Some hooks are in place. Please search the code for a full list. Below are some of them with examples.
Filters
You can make the filters display in every page you want. The code below will make them display on every page that has the containing sidebar.
add_filter( 'wmf_display_condition', 'my_wmf_display_condition'); function my_wmf_display_condition( $condition ) { return true; }
You can change the list of the filter types.
add_filter( 'wmf_filter_types', 'my_wmf_filter_types'); function my_wmf_display_condition( $types ) { $types['checkbox'] = __( 'Checkbox', 'wmf'); return $types; }
Actions
You may add your own behaviour on your filter type
add_action( 'wmf_widget_end', 'my_wmf_widget_end', 10, 7 ); function my_wmf_widget_end( $title, $valueslabel, $metakey, $filtertype, $orderby, $autorefresh, $values_array ) { // your code here }
Frequently Asked Questions
-
Can I filter by any custom field (meta data)?
Yes, you can.
-
How do I add my custom meta data on a product?
Edit the product in wp-admin. On the top – right corner of the screen, click on “screen options” and make sure that “Custom Fields” is checked. Scroll to the custom fields metabox and add your custom meta data.
Read more on custom fields -
Can I put this anywhere in my site?
You can put it on any sidebar on your website.
-
What default fields can I filter by?
Some of the default filter fields are:
- weight
- length
- width
- height
- visibility
- stock status
- total sales
- sales price
- regular price
- tax status
- tax class
- featured
- sku
- reviews count
- average rating
-
Can I read the documentation?
Changelog
1.0.5 11/03/2021
- Feature: Added touch/drag slider support for mobile devices
1.0.4 10/25/2021
- Fix: Added missing jQuery UI images
1.0.3 05/02/2021
- Fix: Removed some PHP warnings
1.0.2 09/12/2019
- Feature: Added support for float range filters
1.0.1 04/26/2019
- Fix: Added support for all meta key values
1.0.0 04/24/2019
- Initial release
Sources and Credits
This plugin uses the following libraries