Shoptimizer Brand Filter Widget
A custom WordPress plugin that adds brand/family filtering functionality to WooCommerce archive pages in the Shoptimizer theme.
Features
- Shortcode Support: Use
[shoptimizer_brand_filter]anywhere - Widget Support: Add via WordPress admin widgets area
- Archive Page Integration: Works on shop, category, tag, and taxonomy pages
- Customizable Options: Title, product counts, ordering, limits
- Mobile Responsive: Optimized for all device sizes
- Theme Integration: Styled to match Shoptimizer theme
- Update Safe: Standalone plugin won't be affected by theme updates
Installation
-
Upload Files: Copy the plugin files to your WordPress installation:
/wp-content/plugins/shoptimizer-brand-filter/ ├── shoptimizer-brand-filter.php ├── assets/ │ └── brand-filter.css └── README-Brand-Filter.md -
Activate Plugin: Go to WordPress admin > Plugins > Activate "Shoptimizer Brand Filter Widget"
-
Verify Brand Taxonomy: Ensure your WooCommerce store uses the
product_brandtaxonomy for brands
Usage
Method 1: Shortcode
Add the shortcode to any page, post, or widget:
[shoptimizer_brand_filter]
Shortcode Attributes
[shoptimizer_brand_filter
title="Filter by Brand"
show_count="yes"
hide_empty="yes"
orderby="name"
order="ASC"
limit="0"
show_all_option="yes"
]
Available Attributes:
title- Widget title (default: "Filter by Brand")show_count- Show product count (yes/no, default: yes)hide_empty- Hide brands with no products (yes/no, default: yes)orderby- Sort by name, count, or term_id (default: name)order- ASC or DESC (default: ASC)limit- Maximum brands to show (0 = no limit)show_all_option- Show "All Brands" link (yes/no, default: yes)
Method 2: Widget
- Go to Appearance > Widgets
- Add "Shoptimizer Brand Filter" widget to your sidebar
- Configure the widget settings
- Save changes
Method 3: Template Integration
Add directly to your theme templates:
<?php echo do_shortcode('[shoptimizer_brand_filter]'); ?>
Sidebar Integration
For WooCommerce archive pages, add the widget to your sidebar:
- WordPress Admin > Appearance > Widgets
- Drag Shoptimizer Brand Filter to Sidebar area
- Configure settings:
- Title: "Shop by Brand"
- Show product counts: ✓
- Hide empty brands: ✓
- Order by: Name
- Order: Ascending
Styling
The plugin includes comprehensive CSS that matches the Shoptimizer theme. Key classes:
.shoptimizer-brand-filter /* Main container */
.widget-title /* Widget title */
.product-brands /* Brand list */
.brand-item /* Individual brand */
.current-brand /* Active/selected brand */
.all-brands /* "All Brands" option */
.count /* Product count */
Customization
Custom CSS
Add custom styles in Appearance > Customize > Additional CSS:
.shoptimizer-brand-filter .widget-title {
color: #your-color;
font-size: 18px;
}
.shoptimizer-brand-filter .brand-item a:hover {
background-color: #your-hover-color;
}
Custom Functions
Override plugin behavior in your child theme's functions.php:
// Custom brand query args
add_filter('shoptimizer_brand_filter_args', function($args) {
$args['meta_query'] = array(
array(
'key' => 'featured_brand',
'value' => 'yes',
'compare' => '='
)
);
return $args;
});
Requirements
- WordPress: 5.0 or higher
- WooCommerce: 4.0 or higher
- Theme: Shoptimizer (recommended)
- PHP: 7.4 or higher
- Taxonomy:
product_brandmust exist
Brand Taxonomy Setup
If you don't have the product_brand taxonomy, you can:
- Use a plugin like "Brands for WooCommerce"
- Create manually with this code in functions.php:
add_action('init', function() {
register_taxonomy('product_brand', 'product', array(
'label' => 'Brands',
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => false,
));
});
Troubleshooting
Widget Not Showing
- Check if WooCommerce is active
- Verify you're on a WooCommerce archive page
- Ensure
product_brandtaxonomy exists - Check if there are any brands with products
Styling Issues
- Clear caching plugins
- Check for CSS conflicts
- Verify theme compatibility
- Try disabling other plugins temporarily
No Brands Appearing
- Go to Products > Brands in WordPress admin
- Add/assign brands to products
- Ensure "Hide empty brands" is disabled for testing
Changelog
Version 1.0.0
- Initial release
- Shortcode and widget support
- Mobile responsive design
- Shoptimizer theme integration
- Multiple customization options
Support
For support with this plugin:
- Check the troubleshooting section
- Verify your setup meets requirements
- Test with default theme/plugins disabled
- Contact your developer for custom modifications
License
This plugin is released under GPL v2 or later license.