public ActionResult InsertRemoveHeaders(RemoveHeaderModel model) { var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); var settings = _settingService.LoadSetting <HtmlOptimiserSettings>(storeScope); if (settings.RemoveHeaders == null) { settings.RemoveHeaders = new List <string>(); } settings.RemoveHeaders.Add(model.Name); SaveSettings(settings); return(new NullJsonResult()); }
public ActionResult UpdateRemoveHeaders(RemoveHeaderModel model) { var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); var settings = _settingService.LoadSetting <HtmlOptimiserSettings>(storeScope); settings.RemoveHeaders[model.Index - 1] = model.Name; _settingService.SaveSetting(settings, x => x.RemoveHeaders, storeScope, false); _settingService.ClearCache(); SaveSettings(settings); RestartPlugin(); return(new NullJsonResult()); }