Close

Profile: reencafesa

Avatar

User posts

7 years ago

Excellent, thank you very much now I only have one thing missing. Is it possible to have multiple filter instances? I need in my home, multiple UI modes with different attribute specifications?

7 years ago

hristian.dimov 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!


Excellent, thank you very much now I only have one thing missing. Is it possible to have multiple filter instances? I need in my home, multiple UI modes with different attribute specifications?

7 years ago

Can I put a default category or manufacturer in the filter?

7 years ago

Hello everyone, I want to filter this way:
[Specification_1] [Specification_2] ... [Specification_N]
Or so that [Categories] or [Manufacturers] have the option of everything available and this is always by default, I need to filter without categories or manufacturers.

Thanks