<div class="madeshop-filter">
<div class="filter-block row">
    {% for filter_group in filter_groups %}
    <div class="col-sm-3">
	<a class="filter-name">{{ filter_group.name }}</a>
      <div id="filter-group{{ filter_group.filter_group_id }}" class="filter-group">
        {% for filter in filter_group.filter %}
        <div class="checkbox">
            {% if filter.filter_id in filter_category %}
            <input id="num{{ filter.filter_id }}" type="checkbox" name="filter[]" value="{{ filter.filter_id }}" checked="checked" />            
            {% else %}
            <input id="num{{ filter.filter_id }}" type="checkbox" name="filter[]" value="{{ filter.filter_id }}" />
            {% endif %}
          <label for="num{{ filter.filter_id }}">{{ filter.name }}</label>
        </div>
         {% endfor %}
      </div>
	</div>
    {% endfor %}
</div>
</div>

<script type="text/javascript"><!--
$('.madeshop-filter input').on('click', function() {
	filter = [];

	$('input[name^=\'filter\']:checked').each(function(element) {
		filter.push(this.value);
	});

	location = '{{ action }}&filter=' + filter.join(',');
});
//--></script>
