public ActionResult Configure() { //load settings for a chosen store scope var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); var inviteSettings = _settingService.LoadSetting<InviteSetting>(storeScope); var model = new ConfigurationModel(); model.CodeType = inviteSettings.CodeType; model.MaxCodeLimit = inviteSettings.MaxCodeLimit; model.ActiveStoreScopeConfiguration = storeScope; return View("~/Plugins/Widgets.Invite/Views/WidgetsInvite/Configure.cshtml", model); }
public ActionResult Configure(ConfigurationModel model) { //load settings for a chosen store scope var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); var inviteSettings = _settingService.LoadSetting<InviteSetting>(storeScope); inviteSettings.CodeType = model.CodeType; inviteSettings.MaxCodeLimit = model.MaxCodeLimit; _settingService.SaveSetting(inviteSettings, x => x.CodeType, storeScope); _settingService.SaveSetting(inviteSettings, x => x.MaxCodeLimit, storeScope); //now clear settings cache _settingService.ClearCache(); SuccessNotification(_localizationService.GetResource("Admin.Plugins.Saved")); return Configure(); }