i do not want to show subcategory on left side of web siteexample shown Categories Mba Projects Marketing Projects(subcategory) Human Resource(subcategory) Finance Projects (subcategory) MBA IT(subcategory) Organisation(subcategory) Operations Project(subcategory) in this example i do not want to show subcategory on left side of web site please reply thanks
1. Open \NopCommerceStore\Modules\CategoryNavigation.ascx.cs file 2. Comment the following code in CreateChildMenu() fucntion:
for (int i = 0; i <= breadCrumb.Count - 1; i++) if (breadCrumb[i].CategoryID == category.CategoryID) CreateChildMenu(breadCrumb, category.CategoryID, currentCategory, level);
my code is this now how to change please reply how to change
//------------------------------------------------------------------------------ // The contents of this file are subject to the nopCommerce Public License Version 1.0 ("License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at https://www.nopcommerce.com/License.aspx. // // Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. // See the License for the specific language governing rights and limitations under the License. // // The Original Code is nopCommerce. // The Initial Developer of the Original Code is NopSolutions. // All Rights Reserved. // // Contributor(s): _______. //------------------------------------------------------------------------------
using System; using System.Collections; using System.Configuration; using System.Data; using System.Text; using System.Web; 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.Common.Categories; using NopSolutions.NopCommerce.Common.Products; using NopSolutions.NopCommerce.Common.SEO; using NopSolutions.NopCommerce.Common.Utils;
namespace NopSolutions.NopCommerce.Web.Modules { public partial class CategoryNavigation : BaseNopUserControl { #region Classes public class NopCommerceLi : WebControl, INamingContainer { public NopCommerceLi() { this.HyperLink = new HyperLink(); }
if (currentCategory != null) breadCrumb = CategoryManager.GetBreadCrumb(currentCategory.CategoryID); else breadCrumb = new CategoryCollection();
CreateChildMenu(breadCrumb, 0, currentCategory, 0); for (int i = 0; i <= breadCrumb.Count - 1; i++) if (breadCrumb[i].CategoryID == category.CategoryID) CreateChildMenu(breadCrumb, category.CategoryID, currentCategory, level); }
protected void CreateChildMenu(CategoryCollection breadCrumb, int rootCategoryID, Category currentCategory, int level) { int padding = level++ * 15; foreach (Category category in CategoryManager.GetAllCategories(rootCategoryID)) { NopCommerceLi link = new NopCommerceLi(); phCategories.Controls.Add(link);
if (currentCategory != null) breadCrumb = CategoryManager.GetBreadCrumb(currentCategory.CategoryID); else breadCrumb = new CategoryCollection();
CreateChildMenu(breadCrumb, 0, currentCategory, 0); for (int i = 0; i <= breadCrumb.Count - 1; i++) if (breadCrumb[i].CategoryID == category.CategoryID) CreateChildMenu(breadCrumb, category.CategoryID, currentCategory, level); }
protectedvoid CreateChildMenu(CategoryCollection breadCrumb, int rootCategoryID, Category currentCategory, int level) { int padding = level++ * 15; foreach (Category category in CategoryManager.GetAllCategories(rootCategoryID)) { NopCommerceLi link = new NopCommerceLi(); phCategories.Controls.Add(link);
Hello When am do category parent menu click then display its child sub category then dont display category parent menu only display child sub category menu .. and am using nopcommerce 2.1 version Plz help me
Thank u
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Vous avez encore des questions ou avez besoin d'aide?