Notice
This plugin is provided as-is, with no support or ongoing maintenance. Anyone is free to fork, modify, and use it however they like. Pull requests and issues will not be reviewed or merged. If you want to give a shout-out, that's appreciated but not required.
Tags: woocommerce, filter, product filter, hierarchical, woodmart, ajax, category, attribute, shop, open source
Advanced hierarchical product filtering for WooCommerce.
Version: 1.0.1
WooCommerce Compatibility: 7.0+ with full HPOS support
This plugin extends WooCommerce and the Woodmart theme to provide advanced hierarchical/dependent product filtering capabilities. It allows you to create multi-level filters where each selection affects the available options in subsequent filter levels. Fully compatible with WooCommerce HPOS (High Performance Order Storage) and optimized for modern WordPress environments. No admin interface required – configure all settings via shortcode parameters or the classic widget.
This plugin is open source. No official support is provided. The community is welcome to fork, improve, and contribute via GitHub.
- Hierarchical Filtering: Create dependent filters where each selection affects subsequent options
- Multiple Filter Types: Support for both product attributes and categories
- Shortcode Support: Flexible shortcode for any page or post
- Widget Support: Traditional WordPress widget
- Category Filtering: Include/exclude specific categories
- Product Counts: Show product counts for each filter option
- Responsive Design: Mobile-friendly interface
- Performance Optimized: Caching and efficient database queries
- Security Enhanced: Nonce verification and input sanitization
- Error Logging: Comprehensive logging for debugging
- WooCommerce Compatible: Full compatibility with latest WooCommerce features
- HPOS Ready: Optimized for WooCommerce's High Performance Order Storage
- PHP 8.0+ Safe: No array key warnings or compatibility issues
- WordPress 5.0 or higher
- WooCommerce 7.0 or higher (for full HPOS compatibility)
- PHP 7.4 or higher
- Download and extract the plugin files
- Upload the entire
woodmart-hierarchical-filterdirectory to/wp-content/plugins/ - Activate the plugin through the 'Plugins' menu in WordPress
Add the filter anywhere using the [woodmart_hierarchical_filter] shortcode. You can customize the filter levels, types, labels, and more.
[woodmart_hierarchical_filter attributes="brand,model,power" types="attribute,attribute,attribute" labels="Brand,Model,Power"]
[woodmart_hierarchical_filter attributes="category,brand,category" types="category,attribute,category" labels="Main Category,Brand,Sub Category" include_categories="electronics|automotive,,clothing|accessories" exclude_categories="uncategorized,,sample|test"]
[woodmart_hierarchical_filter attributes="brand,model" types="attribute,attribute" labels="Brand,Model" filter_button_text="Apply Filters" clear_button_text="Reset" show_clear_button="yes"]
[woodmart_hierarchical_filter
attributes="category,brand,category,model"
types="category,attribute,category,attribute"
labels="Vehicle Type,Brand,Series,Model"
include_categories="cars|trucks|motorcycles,,sedans|suvs|pickups,"
exclude_categories="discontinued,,concept,"]
[woodmart_hierarchical_filter
attributes="category,brand,category,size"
types="category,attribute,category,attribute"
labels="Department,Brand,Product Type,Size"
include_categories="electronics|clothing|home,,smartphones|laptops|shirts|pants,"
exclude_categories="uncategorized|sample,,discontinued,"]
- Go to Appearance → Widgets
- Add the "Woodmart Hierarchical Filter" widget to your desired widget area
- Configure the filter settings (attributes, types, labels, etc.)
- attributes: Comma-separated list of filter attributes (e.g., "brand,model,power")
- types: Comma-separated list of filter types ("attribute" or "category")
- labels: Comma-separated list of display labels
- show_counts: Show product counts (yes/no)
- include_categories: Categories to include (use | to separate multiple categories)
- exclude_categories: Categories to exclude (use | to separate multiple categories)
- filter_button_text: Custom text for filter button
- clear_button_text: Custom text for clear button
- show_clear_button: Show/hide clear button (yes/no)
-
Filters Not Working:
- Check that WooCommerce is properly configured
- Ensure products have the required attributes
- Verify product categories are set up correctly
-
Performance Issues:
- Enable caching in the plugin settings
- Check server performance and database optimization
- Consider reducing the number of filter levels
-
AJAX Errors:
- Check browser console for JavaScript errors
- Verify nonce is being generated correctly
- Check server error logs
Enable WordPress debug mode to see detailed error messages:
// Add to wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);The plugin uses WooCommerce's logging system. To view logs:
- Go to WooCommerce → Status → Logs
- Look for logs with source "whf-plugin", "whf-filter", or "whf-admin"
The plugin implements several security measures:
- Nonce Verification: All AJAX requests are protected with nonces
- Input Sanitization: All user inputs are properly sanitized
- Capability Checks: Admin functions check user capabilities
- SQL Prepared Statements: Database queries use prepared statements
- XSS Protection: Output is properly escaped
This plugin is not officially supported. Please do not contact the original authors for support. If you encounter issues or want to improve the plugin, you are encouraged to fork the repository and submit pull requests or open issues on GitHub.
- Fork the plugin and make it your own!
- Submit improvements via pull requests
- Report bugs and suggest features via GitHub issues
This plugin is licensed under the GPL v2 or later.
Originally developed by K2D | SoloByte Ltd. for enhanced WooCommerce filtering capabilities.
** No official support is provided. Fork, improve, and share!**