Category Page Product Filters

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 Jahre weitere
getting loads of error while compiling ctrlpricerangefilter could not be found etc..
13 Jahre weitere
I tried to follow the instructions but it does not work.I use nop 1.9. Can you hellp me?
13 Jahre weitere
for me it is working in 1.9.Can you hellp me.?
13 Jahre weitere
Category page product Fitters nop 1.9

In Category.ascx:


<%@ Register TagPrefix="nopCommerce" TagName="MiniShoppingCartBox" Src="~/Modules/MiniShoppingCartBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="CategoryNavigation" Src="~/Modules/CategoryNavigation.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="ManufacturerNavigation" Src="~/Modules/ManufacturerNavigation.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="RecentlyViewedProducts" Src="~/Modules/RecentlyViewedProductsBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="ProductSpecificationFilter" Src="~/Modules/ProductSpecificationFilter.ascx" %>

<script runat="server">
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            ctrlProductSpecificationFilter.CategoryId = this.CategoryId;
            ctrlProductSpecificationFilter.ReservedQueryStringParams = "CategoryId,";
            ctrlProductSpecificationFilter.ReservedQueryStringParams += "orderby,";
            ctrlProductSpecificationFilter.ReservedQueryStringParams += ctrlPriceRangeFilter.QueryStringProperty;
        }

        protected override void OnPreRender(EventArgs e)
        {
            this.pnlFilters.Visible = ctrlPriceRangeFilter.Visible || ctrlProductSpecificationFilter.Visible;
            base.OnPreRender(e);
        }
        //

</script>




<asp:Content ID="Content2" ContentPlaceHolderID="cph2" runat="server">
    <nopCommerce:CategoryNavigation ID="ctrlCategoryNavigation" runat="server" />
    <div class="clear">
    </div>
    <nopCommerce:ManufacturerNavigation ID="ctrlManufacturerNavigation" runat="server" />
    <div class="clear">
    </div>
    <asp:Panel runat="server" ID="pnlFilters" CssClass="product-filters">
        <div class="filter-title">
            <asp:Label runat="server" ID="lblProductFilterTitle">
                <%=GetLocaleResourceString("Products.FilterOptionsTitle")%>
            </asp:Label>
        </div>
        <div class="filter-item">
            <nopCommerce:PriceRangeFilter ID="ctrlPriceRangeFilter" runat="server" />
        </div>
        <div class="filter-item">
            <nopCommerce:ProductSpecificationFilter ID="ctrlProductSpecificationFilter" runat="server" />
        </div>
    </asp:Panel>
    <div class="clear">
    </div>

    <nopCommerce:RecentlyViewedProducts ID="ctrlRecentlyViewedProducts" runat="server" />
    <div class="clear">
    </div>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="Server">
    <asp:PlaceHolder runat="server" ID="CategoryPlaceHolder"></asp:PlaceHolder>
</asp:Content>
12 Jahre weitere
Everthing is working fine for me, but i cant remove the product filters from its defualt location on the category page, when i comment product filter option on product grid templete i get loads of error whiole comipling.. need some help on this.
12 Jahre weitere
Guys

Can somebody help me remove the filters from the main category page as I have successfully implemented it on the left side, please assist on this..

http://www.lanoscomputers.com/estore/category/78-speakers.aspx
12 Jahre weitere
kakoli wrote:
Guys

Can somebody help me remove the filters from the main category page as I have successfully implemented it on the left side, please assist on this..

http://www.lanoscomputers.com/estore/category/78-speakers.aspx


Uncomment this

<!--
    <asp:Panel runat="server" ID="pnlFilters" CssClass="ProductFilters">
        <div class="FilterTitle">
            <asp:Label runat="server" ID="lblProductFilterTitle">
                <%=GetLocaleResourceString("Products.FilterOptionsTitle")%>
            </asp:Label>
        </div>
        <div class="FilterItem">
            <nopCommerce:PriceRangeFilter ID="ctrlPriceRangeFilter" runat="server" />
        </div>
        <div class="FilterItem">
            <nopCommerce:ProductSpecificationFilter ID="ctrlProductSpecificationFilter" runat="server" />
        </div>
</asp:Panel>
-->
In Templates>Category>ProductsInGrid.ascx and ProductsInLines1.ascx or ProductsInGrid.ascx whichever you are used.
12 Jahre weitere
Thank for your advise, but the code you specified is already uncommented
12 Jahre weitere
I still can't make it work on my 1.9. Can anyone help me to figure out what have I done wrong?

In Category.ascx added:

<%@ Register TagPrefix="nopCommerce" TagName="PriceRangeFilter" Src="~/Modules/PriceRangeFilter.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="ProductSpecificationFilter" Src="~/Modules/ProductSpecificationFilter.ascx" %>

<asp:Content ID="Content2" ContentPlaceHolderID="cph2" runat="server">
    <nopCommerce:CategoryNavigation ID="ctrlCategoryNavigation" runat="server" />
    <div class="clear">
    </div>
    <nopCommerce:ManufacturerNavigation ID="ctrlManufacturerNavigation" runat="server" />
    <div class="clear">
    </div>
    <asp:Panel runat="server" ID="pnlFilters" CssClass="product-filters">
        <div class="filter-title">
            <asp:Label runat="server" ID="lblProductFilterTitle">
                <%=GetLocaleResourceString("Products.FilterOptionsTitle")%>
            </asp:Label>
        </div>
        <div class="filter-item">
            <nopCommerce:PriceRangeFilter ID="ctrlPriceRangeFilter" runat="server" />
        </div>
        <div class="filter-item">
            <nopCommerce:ProductSpecificationFilter ID="ctrlProductSpecificationFilter" runat="server" />
        </div>
    </asp:Panel>
    <div class="clear">
    </div>
    <nopCommerce:RecentlyViewedProducts ID="ctrlRecentlyViewedProducts" runat="server" />
    <div class="clear">
    </div>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="Server">
    <asp:PlaceHolder runat="server" ID="CategoryPlaceHolder"></asp:PlaceHolder>
</asp:Content>

codebehind in category.aspx.cs added

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.CreateChildControlsTree();

            ctrlProductSpecificationFilter.CategoryId = this.CategoryId;
            ctrlPriceRangeFilter.PriceRanges = category.PriceRanges;

            ctrlProductSpecificationFilter.ReservedQueryStringParams = "CategoryID,";
            ctrlProductSpecificationFilter.ReservedQueryStringParams += "pageindex,";
            ctrlProductSpecificationFilter.ReservedQueryStringParams += "orderby,";
            ctrlProductSpecificationFilter.ReservedQueryStringParams += ctrlPriceRangeFilter.QueryStringProperty;
        }

        protected override void OnPreRender(EventArgs e)
        {
            this.pnlFilters.Visible = ctrlPriceRangeFilter.Visible || ctrlProductSpecificationFilter.Visible;
            base.OnPreRender(e);
        }

In Category.aspx.designer.cs Added the following controls

        protected global::System.Web.UI.WebControls.Panel pnlFilters;

        protected global::System.Web.UI.WebControls.Label lblProductFilterTitle;

        protected global::NopSolutions.NopCommerce.Web.Modules.PriceRangeFilterControl ctrlPriceRangeFilter;

        protected global::NopSolutions.NopCommerce.Web.Modules.ProductSpecificationFilterControl ctrlProductSpecificationFilter;

        protected global::NopSolutions.NopCommerce.Controls.Pager productsPager;
12 Jahre weitere
I have figured out how to recompile the whole project. After that it works for me.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.