Exemple #1
0
 public CatalogManager(CatalogServiceProvider catalogServiceProvider, GlobalizationServiceProvider globalizationServiceProvider, PricingManager pricingManager, InventoryManager inventoryManager, CatalogItemContext catalogItemContext, ICommerceSearchManager commerceSearchManager, StorefrontContext storefrontContext)
 {
     CatalogServiceProvider       = catalogServiceProvider;
     GlobalizationServiceProvider = globalizationServiceProvider;
     PricingManager        = pricingManager;
     InventoryManager      = inventoryManager;
     CatalogItemContext    = catalogItemContext;
     CommerceSearchManager = commerceSearchManager;
     StorefrontContext     = storefrontContext;
 }
Exemple #2
0
        public ManagerResponse <GlobalizationResult, bool> RaiseCultureChosenPageEvent(string culture)
        {
            Assert.ArgumentNotNullOrEmpty(culture, nameof(culture));

            if (StorefrontContext.Current == null)
            {
                throw new InvalidOperationException("Cannot be called without a valid storefront context.");
            }

            var result = GlobalizationServiceProvider.CultureChosen(new CultureChosenRequest(StorefrontContext.Current.ShopName, culture));

            return(new ManagerResponse <GlobalizationResult, bool>(result, result.Success));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CatalogManager" /> class.
        /// </summary>
        /// <param name="catalogServiceProvider">The catalog service provider.</param>
        /// <param name="globalizationServiceProvider">The globalization service provider.</param>
        /// <param name="pricingManager">The pricing manager.</param>
        /// <param name="inventoryManager">The inventory manager.</param>
        public CatalogManager([NotNull] CatalogServiceProvider catalogServiceProvider, [NotNull] GlobalizationServiceProvider globalizationServiceProvider, [NotNull] PricingManager pricingManager, [NotNull] InventoryManager inventoryManager)
        {
            Assert.ArgumentNotNull(catalogServiceProvider, "catalogServiceProvider");
            Assert.ArgumentNotNull(pricingManager, "pricingManager");
            Assert.ArgumentNotNull(inventoryManager, "inventoryManager");

            this.CatalogServiceProvider       = catalogServiceProvider;
            this.GlobalizationServiceProvider = globalizationServiceProvider;
            this.PricingManager   = pricingManager;
            this.InventoryManager = inventoryManager;
        }