- Plugin Name: Custom Filters
- Description: A Plugin For Custom Filters In WordPress.
- Version: 1.0.0
- Author: Hassan Ali Askari
- Author URI: Telegram
- Plugin URI: GitHub
- License: MIT
- License URI: MIT License
- Email: hassanali7303@gmail.com
- Domain Path: Domain
- Download the plugin.
- Upload the plugin folder to the
/wp-content/plugins/
directory. - Activate the plugin through the 'Plugins' menu in WordPress.
To display the custom filters in your posts or pages, use the following shortcode:
[custom_filters]
This plugin creates a tabbed filter system for car products in WooCommerce. It includes:
- Tabbed Interface: Filter products based on car types (Light Vehicles, Heavy Vehicles, API/SAE, Industrial).
- Brand Selection: Choose brands based on car types.
- Category Filtering: Filter products by category.
- AJAX Search: Filter results are loaded without page refresh using AJAX.
-
Light Vehicles (خودروهای سبک):
- Filters include
Brand
andCar
.
- Filters include
-
Heavy Vehicles (خودروهای سنگین):
- Filters include
Brand
andCar
.
- Filters include
-
API / SAE:
- Select different levels of API or SAE.
-
Industrial (صنعتی):
- Redirects to a product category page with industrial products.
This plugin uses WooCommerce product taxonomies for filtering:
pa_brand
: Brand taxonomy for cars.pa_car
: Car taxonomy.product_cat
: Product categories.
To fetch terms for the filter dropdowns:
$brand_terms = get_terms(array(
'taxonomy' => 'pa_brand',
'hide_empty' => false,
));