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,
                              MeasureSettings measureSettings,
                              GoogleShoppingSettings googleShoppingSettings,
                              CurrencySettings currencySettings,
                              GoogleProductObjectContext objectContext)
 {
     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._measureSettings        = measureSettings;
     this._googleShoppingSettings = googleShoppingSettings;
     this._currencySettings       = currencySettings;
     this._objectContext          = objectContext;
 }
Example #2
0
        /// <summary>
        /// Install plugin
        /// </summary>
        public override void Install()
        {
            //settings
            var settings = new GoogleShoppingSettings
            {
                PricesConsiderPromotions   = false,
                ProductPictureSize         = 125,
                PassShippingInfoWeight     = false,
                PassShippingInfoDimensions = false,
                StaticFileName             = $"googleshopping_{CommonHelper.GenerateRandomDigitCode(10)}.xml",
                ExpirationNumberOfDays     = 28
            };

            _settingService.SaveSetting(settings);

            //data
            _objectContext.Install();

            //locales
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Store", "Store");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Store.Hint", "Select the store that will be used to generate the feed.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Currency", "Currency");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Currency.Hint", "Select the default currency that will be used to generate the feed.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.DefaultGoogleCategory", "Default Google category");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.DefaultGoogleCategory.Hint", "The default Google category to use if one is not specified.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.ExceptionLoadPlugin", "Cannot load the plugin");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.General", "General");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.GeneralInstructions", "<p><ul><li>At least two unique product identifiers are required. So each of your product should have manufacturer (brand) and MPN (manufacturer part number) specified</li><li>Specify default tax values in your Google Merchant Center account settings</li><li>Specify default shipping values in your Google Merchant Center account settings</li><li>In order to get more info about required fields look at the following article <a href=\"http://www.google.com/support/merchants/bin/answer.py?answer=188494\" target=\"_blank\">http://www.google.com/support/merchants/bin/answer.py?answer=188494</a></li></ul></p>");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Generate", "Generate feed");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Override", "Override product settings");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.OverrideInstructions", "<p>You can download the list of allowed Google product category attributes <a href=\"http://www.google.com/support/merchants/bin/answer.py?answer=160081\" target=\"_blank\">here</a></p>");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.PassShippingInfoWeight", "Pass shipping info (weight)");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.PassShippingInfoWeight.Hint", "Check if you want to include shipping information (weight) in generated XML file.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.PassShippingInfoDimensions", "Pass shipping info (dimensions)");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.PassShippingInfoDimensions.Hint", "Check if you want to include shipping information (dimensions) in generated XML file.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.PricesConsiderPromotions", "Prices consider promotions");
            _localizationService.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.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.ProductPictureSize", "Product thumbnail image size");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.ProductPictureSize.Hint", "The default size (pixels) for product thumbnail images.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.ProductName", "Product");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.ProductName.Hint", "Product Name");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.GoogleCategory", "Google Category");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.GoogleCategory.Hint", "Product category according to the Google product taxonomy.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.Gender", "Gender");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.Gender.Hint", "Gender of the people for whom the product is intended.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.AgeGroup", "Age group");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.AgeGroup.Hint", "Age category of people for whom the goods are intended.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.Color", "Color");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.Color.Hint", "Product color.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.Size", "Size");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.Size.Hint", "Product size.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.CustomGoods", "Custom goods");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.Products.CustomGoods.Hint", "Custom goods (no identifier exists).");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.SuccessResult", "Google Shopping feed has been successfully generated.");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.StaticFilePath", "Generated file path (static)");
            _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Feed.GoogleShopping.StaticFilePath.Hint", "A file path of the generated file. It's static for your store and can be shared with the Google Shopping service.");

            base.Install();
        }
 public GoogleShoppingService(IGoogleService googleService,
                              IPriceCalculationService priceCalculationService,
                              ITaxService taxService,
                              IProductService productService,
                              ICategoryService categoryService,
                              IManufacturerService manufacturerService,
                              IPictureService pictureService,
                              ICurrencyService currencyService,
                              ILanguageService languageService,
                              ILocalizationService localizationService,
                              ISettingService settingService,
                              IWorkContext workContext,
                              IMeasureService measureService,
                              MeasureSettings measureSettings,
                              GoogleShoppingSettings googleShoppingSettings,
                              CurrencySettings currencySettings,
                              SecuritySettings securitySettings,
                              GoogleProductObjectContext objectContext,
                              IWebHelper webHelper,
                              IHostingEnvironment hostingEnvironment,
                              IUrlHelperFactory urlHelperFactory,
                              IUrlRecordService urlRecordService,
                              IActionContextAccessor actionContextAccessor,
                              TaxSettings taxSettings)
 {
     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._localizationService    = localizationService;
     this._settingService         = settingService;
     this._workContext            = workContext;
     this._measureService         = measureService;
     this._measureSettings        = measureSettings;
     this._googleShoppingSettings = googleShoppingSettings;
     this._currencySettings       = currencySettings;
     this._securitySettings       = securitySettings;
     this._objectContext          = objectContext;
     this._webHelper             = webHelper;
     this._hostingEnvironment    = hostingEnvironment;
     this._urlHelperFactory      = urlHelperFactory;
     this._urlRecordService      = urlRecordService;
     this._actionContextAccessor = actionContextAccessor;
     this._taxSettings           = taxSettings;
 }
Example #4
0
        /// <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);

            //data
            _objectContext.Install();

            //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", "Google Shopping 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 file. It's static for your store and can be shared with the Google Shopping service.");

            base.Install();
        }