Beispiel #1
0
        public void ShowCategory(int id, int rootID, int parentID)
        {
            if (ProductInfoCatalog != null)
            {
                Category_V02 category     = CatalogHelper.FindCategory(ProductInfoCatalog, id, parentID, rootID);
                Category_V02 rootCategory = CatalogHelper.FindCategory(ProductInfoCatalog, rootID);
                if (category != null &&
                    rootCategory != null &&
                    CatalogProvider.IsDisplayable(rootCategory, Thread.CurrentThread.CurrentCulture.Name))
                {
                    CategoryName.Text            = category.DisplayName;
                    Overview.Text                = category.Description;
                    DivImage.Style["background"] = "url(" + category.ImagePath +
                                                   ");background-repeat: no-repeat; background-position: center right";
                    SubCat.PopulateProducts(category, rootCategory);

                    if (HLConfigManager.Configurations.DOConfiguration.AddScriptsForRecommendations)
                    {
                        // Send data to Adobe Target and Salesforce, only for main categories
                        if (category.ID == rootCategory.ID)
                        {
                            AT_categoryName = string.Format("{0}_{1}", Locale, category.DisplayName);
                        }
                    }
                }
                else
                {
                    if (!(id == 0 && rootID == 0 && parentID == 0))
                    {
                        LoggerHelper.Warn(string.Format("No category found in ShowCategory for {0}-{2}-{3} {1}", id, this.Locale, rootID, parentID));
                    }
                }
            }
        }
Beispiel #2
0
        private Category_V02 findRootCategory(bool eventTicketMode, List <Category_V02> rootCategories)
        {
            Category_V02 current = null;

            foreach (Category_V02 category in rootCategories)
            {
                // Validate category display by rule
                if (CatalogProvider.IsDisplayable(category, Locale))
                {
                    if (Menu.ShouldTake(category, eventTicketMode, SessionInfo.ShowAllInventory, SessionInfo.IsHAPMode))
                    {
                        current = category;
                        break;
                    }
                }
            }

            return(current);
        }