/// <summary> /// Install plugin /// </summary> public override void Install() { //settings var settings = new GoogleShoppingSettings { PricesConsiderPromotions = false, ProductPictureSize = 125, PassShippingInfoWeight = false, PassShippingInfoDimensions = false, StaticFileName = string.Format("GoogleShopping_{0}.xml", CommonHelper.GenerateRandomDigitCode(10)), ExpirationNumberOfDays = 28 }; _settingService.SaveSetting(settings); //locales this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Store", "Store"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Store.Hint", "Select the store that will be used to generate the feed."); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Currency", "Currency"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Currency.Hint", "Select the default currency that will be used to generate the feed."); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.DefaultGoogleCategory", "Default Google category"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.DefaultGoogleCategory.Hint", "The default Google category to use if one is not specified."); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.General", "General"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Generate", "Generate feed"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Override", "Override product settings"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.PassShippingInfoWeight", "Pass shipping info (weight)"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.PassShippingInfoWeight.Hint", "Check if you want to include shipping information (weight) in generated XML file."); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.PassShippingInfoDimensions", "Pass shipping info (dimensions)"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.PassShippingInfoDimensions.Hint", "Check if you want to include shipping information (dimensions) in generated XML file."); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.PricesConsiderPromotions", "Prices consider promotions"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.PricesConsiderPromotions.Hint", "Check if you want prices to be calculated with promotions (tier prices, discounts, special prices, tax, etc). But please note that it can significantly reduce time required to generate the feed file."); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.ProductPictureSize", "Product thumbnail image size"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.ProductPictureSize.Hint", "The default size (pixels) for product thumbnail images."); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.ProductName", "Product"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.GoogleCategory", "Google Category"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.Gender", "Gender"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.AgeGroup", "Age group"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.Color", "Color"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.Size", "Size"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.CustomGoods", "Custom goods (no identifier exists)"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.SuccessResult", "GoogleShopping feed has been successfully generated."); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.StaticFilePath", "Generated file path (static)"); this.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.StaticFilePath.Hint", "A file path of the generated GoogleShopping file. It's static for your store and can be shared with the GoogleShopping service."); base.Install(); }
public GoogleShoppingService(IGoogleService googleService, IPriceCalculationService priceCalculationService, ITaxService taxService, IProductService productService, ICategoryService categoryService, IManufacturerService manufacturerService, IPictureService pictureService, ICurrencyService currencyService, ILanguageService languageService, ISettingService settingService, IWorkContext workContext, IMeasureService measureService, IServiceProvider serviceProvider, MeasureSettings measureSettings, GoogleShoppingSettings googleShoppingSettings, CurrencySettings currencySettings, MediaSettings mediaSettings, SecuritySettings securitySettings, IWebHelper webHelper, IUrlHelperFactory urlHelperFactory, IActionContextAccessor actionContextAccessor) { this._googleService = googleService; this._priceCalculationService = priceCalculationService; this._taxService = taxService; this._productService = productService; this._categoryService = categoryService; this._manufacturerService = manufacturerService; this._pictureService = pictureService; this._currencyService = currencyService; this._languageService = languageService; this._settingService = settingService; this._workContext = workContext; this._measureService = measureService; this._serviceProvider = serviceProvider; this._measureSettings = measureSettings; this._googleShoppingSettings = googleShoppingSettings; this._currencySettings = currencySettings; this._mediaSettings = mediaSettings; this._securitySettings = securitySettings; this._webHelper = webHelper; this._urlHelperFactory = urlHelperFactory; this._actionContextAccessor = actionContextAccessor; }
public GoogleShoppingService(IGoogleService googleService, IPriceCalculationService priceCalculationService, ITaxService taxService, IProductService productService, ICategoryService categoryService, IManufacturerService manufacturerService, IPictureService pictureService, ICurrencyService currencyService, ILanguageService languageService, ISettingService settingService, IWorkContext workContext, IMeasureService measureService, ILocalizationService localizationService, MeasureSettings measureSettings, GoogleShoppingSettings googleShoppingSettings, CurrencySettings currencySettings, IWebHelper webHelper, IUrlHelperFactory urlHelperFactory, IActionContextAccessor actionContextAccessor) { _googleService = googleService; _priceCalculationService = priceCalculationService; _taxService = taxService; _productService = productService; _categoryService = categoryService; _manufacturerService = manufacturerService; _pictureService = pictureService; _currencyService = currencyService; _languageService = languageService; _settingService = settingService; _workContext = workContext; _measureService = measureService; _localizationService = localizationService; _measureSettings = measureSettings; _googleShoppingSettings = googleShoppingSettings; _currencySettings = currencySettings; _webHelper = webHelper; _urlHelperFactory = urlHelperFactory; _actionContextAccessor = actionContextAccessor; }