Example #1
0
        /// <summary>
        ///     Set the google analytics information for the current store.
        /// </summary>
        /// <param name="newSettings"></param>
        public virtual void SetGoogleAnalyticsSettings(GoogleAnalyticsSettings newSettings)
        {
            var store = Stores.FindById(Context.CurrentStore.Id);

            store.Settings.SetProp("UseGoogleTracker", newSettings.UseTracker);
            store.Settings.SetProp("GoogleTrackerId", newSettings.TrackerId);
            Stores.Update(store);
        }
Example #2
0
        /// <summary>
        ///     Get Google Analytics settings for a current store.
        /// </summary>
        /// <returns>Returns <see cref="GoogleAnalyticsSettings" /> instance</returns>
        public virtual GoogleAnalyticsSettings GetGoogleAnalyticsSettings()
        {
            var store  = Stores.FindByIdWithCache(Context.CurrentStore.Id);
            var result = new GoogleAnalyticsSettings();

            result.UseTracker = store.Settings.GetPropBool("UseGoogleTracker");
            result.TrackerId  = store.Settings.GetProp("GoogleTrackerId");
            return(result);
        }