protected override void OnLoad(System.EventArgs e) { var entry = CurrentContent as EntryContentBase; var currentMarket = CurrentMarket.GetCurrentMarket(); //Only redirected if not in edit view if (entry != null && !PageEditing.PageIsInEditMode) { if (entry.MarketFilter.Any(market => new MarketId(market) == currentMarket.MarketId)) { Context.RedirectFast(GetUrl(Settings.MarketNotSupportedPage)); return; } if (currentMarket.Languages.All(l => l.Name != ContentLanguage.PreferredCulture.Name)) { Context.RedirectFast(GetUrl(entry.ContentLink, currentMarket.DefaultLanguage.Name)); return; } } base.OnLoad(e); // Increase viewed count by calling the IncreaseView method in CmoGadgetController. if (!IsPostBack && entry != null) { CmoGadgetController.IncreaseView(entry.Code); } }
/// <summary> /// Increases the KPI if placing order successfully. /// </summary> private void IncreaseKpi() { CmoGadgetController.IncreaseOrder(CartHelper.LineItems); }