Category Page Product Filters

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
It is category.aspx

<%@ Page Language="C#" MasterPageFile="~/MasterPages/TwoColumn.master" AutoEventWireup="true"
    Inherits="NopSolutions.NopCommerce.Web.CategoryPage" CodeBehind="Category.aspx.cs" %>
<%@ 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="PriceRangeFilter" Src="~/Modules/PriceRangeFilter.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="ProductSpecificationFilter" Src="~/Modules/ProductSpecificationFilter.ascx" %>

<asp:Content ID="Content2" ContentPlaceHolderID="cph2" runat="server">
    <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>
</asp:Content>


<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="Server">
    <asp:PlaceHolder runat="server" ID="CategoryPlaceHolder"></asp:PlaceHolder>
</asp:Content>



It is category aspx.cs


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Text;
using System.Web;
using System.Web.Caching;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using NopSolutions.NopCommerce.BusinessLogic;
using NopSolutions.NopCommerce.BusinessLogic.Categories;
using NopSolutions.NopCommerce.BusinessLogic.Configuration.Settings;
using NopSolutions.NopCommerce.BusinessLogic.SEO;
using NopSolutions.NopCommerce.BusinessLogic.Templates;
using NopSolutions.NopCommerce.Common.Utils;
using NopSolutions.NopCommerce.Common;

namespace NopSolutions.NopCommerce.Web
{
    public partial class CategoryPage : BaseNopPage
    {
        Category category = null;

        private void CreateChildControlsTree()
        {
            category = CategoryManager.GetCategoryById(this.CategoryId);
            if (category != null)
            {
                Control child = null;

                CategoryTemplate categoryTemplate = category.CategoryTemplate;
                if (categoryTemplate == null)
                    throw new NopException(string.Format("Category template path can not be empty. CategoryID={0}", category.CategoryId));

                child = base.LoadControl(categoryTemplate.TemplatePath);
                this.CategoryPlaceHolder.Controls.Add(child);
            }
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.CreateChildControlsTree();
            ctrlProductSpecificationFilter.CategoryID = this.CategoryID;
            ctrlPriceRangeFilter.PriceRanges = category.PriceRanges;

            ctrlProductSpecificationFilter.ReservedQueryStringParams = "CategoryID,";
        }
protected void Page_Load(object sender, EventArgs e)
        {
            if (category == null || category.Deleted || !category.Published)
                Response.Redirect(CommonHelper.GetStoreLocation());

            string title = string.Empty;
            if (!string.IsNullOrEmpty(category.LocalizedMetaTitle))
                title = category.LocalizedMetaTitle;
            else
                title = category.LocalizedName;
            SEOHelper.RenderTitle(this, title, true);
            SEOHelper.RenderMetaTag(this, "description", category.LocalizedMetaDescription, true);
            SEOHelper.RenderMetaTag(this, "keywords", category.LocalizedMetaKeywords, true);

            if (!Page.IsPostBack)
            {
                NopContext.Current.LastContinueShoppingPage = CommonHelper.GetThisPageUrl(true);
            }
        }

        public int CategoryId
        {
            get
            {
                return CommonHelper.QueryStringInt("CategoryId");
            }
        }

        public override PageSslProtectionEnum SslProtected
        {
            get
            {
                return PageSslProtectionEnum.No;
            }
        }
      


    }
}

Help where is error. Thanks You
13 years ago
Why don't you contact the creators of that skin: http://gifts.nopcommerceskin.com/category/51-notebooks.aspx
13 years ago
I think this topic  interesting also another people why use nopcommerce. Besides, message "venkat" help me , but am not all understand how do it. I try to understand. It all
13 years ago
Really no one knows?
13 years ago
Hi people, I'm looking for solution "filters in left menu" too. Please can somebody explain it? thaks
13 years ago
This is not working for nop1.9, any help on this would be appricated .
13 years ago
Hi all again. You can use this theme
http://gifts.nopcommerceskin.com/category/51-notebooks.aspx
13 years ago
Any confirmation whether this is possible for 1.9? If so then please share how you done this to useless people like me with very little code knowledge.
13 years ago
Is there anyone who implimented this on 1.9, I am not able to make it work on 1.9 :(, somebody please guide..
13 years ago
for me it is working in 1.9...
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.