public WB_FixedOrByCountryStateZipTaxProvider(IWB_CountryStateZipService taxRateService, IStoreContext storeContext, WB_CountryStateZipObjectContext objectContext, ICacheManager cacheManager, ISettingService settingService, WB_FixedOrByCountryStateZipTaxSettings countryStateZipSettings, ICategoryService categoryService, IWB_TaxCategoryMappingService taxCategoryMappingService ) { this._taxRateService = taxRateService; this._storeContext = storeContext; this._objectContext = objectContext; this._cacheManager = cacheManager; this._settingService = settingService; this._countryStateZipSettings = countryStateZipSettings; this._categoryService = categoryService; this._taxCategoryMappingService = taxCategoryMappingService; }
/// <summary> /// Install plugin /// </summary> public override void Install() { //database objects _objectContext.Install(); //settings var settings = new WB_FixedOrByCountryStateZipTaxSettings { CountryStateZipEnabled = false }; _settingService.SaveSetting(settings); //locales this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fixed", "Fixed rate"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.TaxByCountryStateZip", "By Country"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.TaxCategoryMapping", "By Category"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.TaxCategoryName", "Tax category"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.Rate", "Rate"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.Store", "Store"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.Store.Hint", "If an asterisk is selected, then this shipping rate will apply to all stores."); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.Country", "Country"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.Country.Hint", "The country."); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.StateProvince", "State / province"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.StateProvince.Hint", "If an asterisk is selected, then this tax rate will apply to all customers from the given country, regardless of the state."); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.Zip", "Zip"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.Zip.Hint", "Zip / postal code. If zip is empty, then this tax rate will apply to all customers from the given country or state, regardless of the zip code."); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.TaxCategory", "Tax category"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.TaxCategory.Hint", "The tax category."); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.Value", "Value"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.Value.Hint", "The tax rate."); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.IsPercent", "Is Calculated in percent ? "); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.IsPercent.Hint", "The Is Percent."); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.AddRecord", "Add tax rate"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.AddRecordTitle", "New tax rate"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.Percentage", "Percentage"); this.AddOrUpdatePluginLocaleResource("Plugins.Tax.Worldbuy.FixedOrByCountryStateZip.Fields.Category", "Category"); base.Install(); }