WP Manifestindependent plugin directory
manifest / ecommerce / otomaties-woocommerce-product-filters

Otomaties WooCommerce Product Filters

Add product filters to WooCommerce

★ 4stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/tombroucke/otomaties-woocommerce-product-filters/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Woocommerce Product Filters

Installation

Require package

composer require tombroucke/otomaties-woocommerce-product-filters

Generate key

wp acorn key:generate

Add livewire styles and script

add_filter('wp_head', function () {
    echo Blade::render('@livewireStyles');
});

add_filter('wp_footer', function () {
    echo Blade::render('@livewireScripts');
});

Publish config file

wp acorn vendor:publish --tag="product-filters-config"

Update config file

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | ProductFilters Package
    |--------------------------------------------------------------------------
    */

    'filters' => [
        'search' => [
            'title' => 'Search',
            'component' => 'search',
        ],
        'product_category' => [
            'title' => 'Product Category',
            'component' => 'checkbox',
            'type' => 'taxonomy',
            'taxonomy' => 'product_cat',
        ],
        'custommeta' => [
            'title' => 'Custom meta',
            'component' => 'checkbox',
            'type' => 'meta',
            'meta_key' => 'custom_meta',
        ],
        'features' => [
            'title' => 'Features',
            'component' => 'select',
            'type' => 'taxonomy',
            'taxonomy' => 'pa_features',
        ],
        'size' => [
            'title' => 'Size',
            'component' => 'select',
            'type' => 'taxonomy',
            'taxonomy' => 'pa_size',
        ],
        'price' => [
            'title' => 'Price',
            'component' => 'price',
        ],
    ],
];

Include livewire components

In archive-product.blade.php

<livewire:products />

Optimize clear

wp acorn optimize:clear

Optional: publish views

wp acorn vendor:publish --tag="product-filters-views"