public ActionResult RestoreScripts()
        {
            var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData);
            var storeScope = this.GetActiveStoreScopeConfiguration(Services.StoreService, Services.WorkContext);
            var settings   = Services.Settings.LoadSetting <GoogleAnalyticsSettings>(storeScope);

            settings.TrackingScript        = GoogleAnalyticsScriptHelper.GetTrackingScript();
            settings.EcommerceScript       = GoogleAnalyticsScriptHelper.GetEcommerceScript();
            settings.EcommerceDetailScript = GoogleAnalyticsScriptHelper.GetEcommerceDetailScript();

            _settingService.SaveSetting(settings, storeScope);

            return(RedirectToConfiguration("SmartStore.GoogleAnalytics", true));
        }
Exemplo n.º 2
0
        public override void Install()
        {
            var settings = new GoogleAnalyticsSettings
            {
                GoogleId              = "UA-0000000-0",
                TrackingScript        = GoogleAnalyticsScriptHelper.GetTrackingScript(),
                EcommerceScript       = GoogleAnalyticsScriptHelper.GetEcommerceScript(),
                EcommerceDetailScript = GoogleAnalyticsScriptHelper.GetEcommerceDetailScript()
            };

            _settingService.SaveSetting(settings);
            _localizationService.ImportPluginResourcesFromXml(this.PluginDescriptor);

            base.Install();
        }