tombroucke / otomaties-woocommerce-product-filters
Product filters for WooCommerce
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Type:wordpress-plugin
Requires
- php: ^8.0
- illuminate/support: *
- livewire/livewire: ^3.0
This package is auto-updated.
Last update: 2024-12-21 14:07:11 UTC
README
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' => [ '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"