reencafesa wrote:Can I put a default category or manufacturer in the filter?
Yes, you can. All you have to do is to modify the "\Plugins\SevenSpikes.Nop.Plugins.AjaxFilters.Pro\Views\AjaxFiltersPro\NopFiltersPro.cshtml" by adding this code at the bottom of the file:
<script type="text/javascript">
$(document).ready(function() {
var dropdownlist = $("#categories").data("kendoDropDownList");
dropdownlist.value("1");
dropdownlist.trigger("change");
$(document).on('nopAjaxFiltersProInitialLoadEvent', function () {
$('.home-page-filter-selector:first input').trigger('change');
});
});
</script>
where $("#categories") is the categories dropdown and .value("1"); is the "id" of the category that you want to pre-select by default.
P.S. if you want to pre-select the manufacturer dropdown instead of categories, change it like this - $("#manufacturers").
P.S 2 - you might wanna change the default value of the specification inputs to "-1" because if you left it with value 0, this will trigger a chain reaction and it will load all of the dropdowns.
from this: <input type="hidden" id="specification_@(spec.Id)" name="specificationOptions" value="0" class="ajaxFiltersProSpecificationItem"
to this: <input type="hidden" id="specification_@(spec.Id)" name="specificationOptions" value="-1" class="ajaxFiltersProSpecificationItem"
Hope this helps!