Example #1
0
        public static Authentication GetN11AuthenticationSettings(N11Settings n11Settings)
        {
            var options = new Authentication
            {
                appKey    = n11Settings.ApiKey,
                appSecret = n11Settings.SecretKey
            };

            return(options);
        }
Example #2
0
        public static N11CategoryService.Authentication GetN11AuthenticationSettingsForCategory(N11Settings n11Settings)
        {
            var options = new N11CategoryService.Authentication
            {
                appKey    = n11Settings.ApiKey,
                appSecret = n11Settings.SecretKey
            };

            return(options);
        }
        public override void Install()
        {
            //settings
            var settings = new N11Settings
            {
                ApiKey             = "",
                SecretKey          = "",
                ApprovalStatus     = "",
                CurrencyType       = "",
                ShipmentTemplate   = "",
                PreparingDay       = "",
                CategoryIdMapping  = "",
                DefaultCategoryId  = 0,
                BrandIdMapping     = "",
                DefaultBrandName   = "",
                LastAddedProductId = 0,
                FailedProductIds   = ""
            };

            _settingService.SaveSetting(settings);

            //install synchronization task
            if (_scheduleTaskService.GetTaskByType("Nop.Plugin.Misc.N11.Services.SynchronizationTask") == null)
            {
                _scheduleTaskService.InsertTask(new ScheduleTask
                {
                    Enabled = true,
                    Seconds = 12 * 60 * 60,
                    Name    = "Synchronization (N11 plugin)",
                    Type    = "Nop.Plugin.Misc.N11.Services.SynchronizationTask",
                });
            }

            //locales
            #region locales
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.Title", "N11 Plugin");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.ApiKey", "N11 API Key");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.ApiKey.Hint", "Enter N11 API Key.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.SecretKey", "N11 Secret Key");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.SecretKey.Hint", "Enter N11 Secret Key.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.ShipmentTemplate", "N11 Shipment Template");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.ShipmentTemplate.Hint", "Enter N11 Shipment Template.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.ApprovalStatus", "N11 Approval Status");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.ApprovalStatus.Hint", "Enter N11 Approval Status.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.PreparingDay", "N11 Preparing Day");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.PreparingDay.Hint", "Enter N11 Preparing Day.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.CurrencyType", "N11 Currency Type");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.CurrencyType.Hint", "Enter N11 Currency Type.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.DefaultCategoryId", "N11 Default Category Id");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.DefaultCategoryId.Hint", "Enter N11 Default Category Id.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.CategoryIdMapping", "N11 Category Id Mapping");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.CategoryIdMapping.Hint", "Enter N11 Category Id Mapping. {nopcommerce-category-id}=>{n11-category-id};{nopcommerce-category-id}=>{n11-category-id} Example: 1=>1001298;2=>1001300");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.DefaultBrandName", "N11 Default Brand Name");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.DefaultBrandName.Hint", "Enter N11 Default Brand Name.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.BrandIdMapping", "N11 Brand Id Mapping");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Fields.BrandIdMapping.Hint", "Enter N11 Brand Id Mapping. {nopcommerce-brand-id}=>{n11-brand-name};{nopcommerce-brand-id}=>{n11-brand-name} Example: 1=>Diğer;2=>Acar");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.Categories.ExportToExcel.All", "Export All N11 Categories To Xlsx");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Misc.N11.Admin.CategoriesAttributes.ExportToExcel.All", "Export All N11 Categories Attributes To Xlsx");
            #endregion

            base.Install();
        }