Skip to content

vadimsva/wc_filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wc_filter

Woocommerce filter plugin


About:

wc_filter is plugin for filter woocoomerce products. Works much faster then other filter plugins. Flexible and easy to set up.
1. Support for multiple types: the standard list (checkboxes), drop-down list, a range of values, the color (or any type that can display an icon, such as a country)
2. Ability to specify the dimension for label, also can hide label
3. Set "or" and "and" query type for filtration of several parameters



How to install:

1. Add in "header.php"

<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_template_directory_uri(); ?>/wc_filter.css" />

2. Add in "footer.php"

<script src="<?php echo get_template_directory_uri(); ?>/wc_filter.js"></script>

3. Add in "functions.php"

include('wc_filter.php');

4. Add in "woocommerce.php"

<div id="filterToggle" class="button" style="display:none">Filter</div>
<div id="filterBlock">
	<div class="block_caption">
		Filter
	</div>
	<div class="block_body">
		
		<div id="wc_filter">
			<?php
			echo wc_getProp('name=global_attr&query=or');
			/*
			name = 'global attribute slug'
			type = 'color', 'input', 'select', ''
			qyery = 'or', 'and'
			init = 'dimension for label, example "kg"'
			nolabel = 'true', '' - show/hide items name, useful for type = 'color'
			*/
			dynamic_sidebar('filter_price');
			?>
			<div class="wc_filter_buttons">
				<button class="btn red" id="wc_filter_reset_but">Reset</button>
				<button class="btn" id="wc_filter_but">Filter</button>
			</div>
		</div>
		
	</div>
</div>

5. In Admin Panel, in Appearence -> Widgets, add in "filter_price -> WooCommerce Filter by price" and add in "filter -> WooCommerce Layered Navigation"