Exemple #1
0
        /// <summary>
        /// Install plugin
        /// </summary>
        /// <returns>A task that represents the asynchronous operation</returns>
        public override async Task InstallAsync()
        {
            //settings
            var settings = new ShipStationSettings
            {
                PackingPackageVolume = 5184
            };
            await _settingService.SaveSettingAsync(settings);

            //locales
            await _localizationService.AddOrUpdateLocaleResourceAsync(new Dictionary <string, string>
            {
                ["Enums.Nop.Plugin.Shipping.ShipStation.PackingType.PackByDimensions"] = "Pack by dimensions",
                ["Enums.Nop.Plugin.Shipping.ShipStation.PackingType.PackByVolume"]     = "Pack by volume",
                ["Plugins.Shipping.ShipStation.Fields.ApiKey.Hint"]               = "Specify ShipStation API key.",
                ["Plugins.Shipping.ShipStation.Fields.ApiKey"]                    = "API key",
                ["Plugins.Shipping.ShipStation.Fields.ApiSecret.Hint"]            = "Specify ShipStation API secret.",
                ["Plugins.Shipping.ShipStation.Fields.ApiSecret"]                 = "API secret",
                ["Plugins.Shipping.ShipStation.Fields.PackingPackageVolume.Hint"] = "Enter your package volume.",
                ["Plugins.Shipping.ShipStation.Fields.PackingPackageVolume"]      = "Package volume",
                ["Plugins.Shipping.ShipStation.Fields.PackingType.Hint"]          = "Choose preferred packing type.",
                ["Plugins.Shipping.ShipStation.Fields.PackingType"]               = "Packing type",
                ["Plugins.Shipping.ShipStation.Fields.Password.Hint"]             = "Specify ShipStation password",
                ["Plugins.Shipping.ShipStation.Fields.Password"]                  = "******",
                ["Plugins.Shipping.ShipStation.Fields.PassDimensions.Hint"]       = "Check if need send dimensions to the ShipStation server",
                ["Plugins.Shipping.ShipStation.Fields.PassDimensions"]            = "Pass dimensions",
                ["Plugins.Shipping.ShipStation.Fields.UserName"]                  = "******",
                ["Plugins.Shipping.ShipStation.Fields.UserName.Hint"]             = "Specify ShipStation user name"
            });

            await base.InstallAsync();
        }
Exemple #2
0
        /// <summary>
        /// Install plugin
        /// </summary>
        public override void Install()
        {
            //settings
            var settings = new ShipStationSettings
            {
                PackingPackageVolume = 5184
            };

            _settingService.SaveSetting(settings);

            //locales
            _localizationService.AddOrUpdatePluginLocaleResource("Enums.Nop.Plugin.Shipping.ShipStation.PackingType.PackByDimensions", "Pack by dimensions");
            _localizationService.AddOrUpdatePluginLocaleResource("Enums.Nop.Plugin.Shipping.ShipStation.PackingType.PackByVolume", "Pack by volume");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.ApiKey.Hint", "Specify ShipStation API key.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.ApiKey", "API key");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.ApiSecret.Hint", "Specify ShipStation API secret.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.ApiSecret", "API secret");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.PackingPackageVolume.Hint", "Enter your package volume.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.PackingPackageVolume", "Package volume");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.PackingType.Hint", "Choose preferred packing type.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.PackingType", "Packing type");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.Password.Hint", "Specify ShipStation password");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.Password", "Password");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.PassDimensions.Hint", "Check if need send dimensions to the ShipStation server");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.PassDimensions", "Pass dimensions");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.UserName", "User name");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Shipping.ShipStation.Fields.UserName.Hint", "Specify ShipStation user name");

            base.Install();
        }
 public ShipStationComputationMethod(ILocalizationService localizationService,
                                     ISettingService settingService,
                                     IShipStationService shipStationService,
                                     IWebHelper webHelper,
                                     ShipStationSettings shipStationSettings)
 {
     _localizationService = localizationService;
     _settingService      = settingService;
     _shipStationService  = shipStationService;
     _webHelper           = webHelper;
     _shipStationSettings = shipStationSettings;
 }