/// <summary> /// Gets the product bulk prices. /// </summary> /// <param name="storefront">The storefront.</param> /// <param name="visitorContext">The visitor context.</param> /// <param name="catalogName">Name of the catalog.</param> /// <param name="productIds">The product ids.</param> /// <returns> /// The manager response with the list of prices in the Result. /// </returns> public virtual ManagerResponse <GetProductBulkPricesResult, IDictionary <string, Price> > GetProductBulkPrices([NotNull] CommerceStorefront storefront, [NotNull] VisitorContext visitorContext, string catalogName, IEnumerable <string> productIds) { Assert.ArgumentNotNull(storefront, "storefront"); var request = new Sitecore.Reference.Storefront.Connect.Pipelines.Arguments.GetProductBulkPricesRequest(catalogName, productIds); request.CurrencyCode = StorefrontManager.GetCustomerCurrency(); var result = this.PricingServiceProvider.GetProductBulkPrices(request); Helpers.LogSystemMessages(result.SystemMessages, result); return(new ManagerResponse <GetProductBulkPricesResult, IDictionary <string, Price> >(result, result.Prices ?? new Dictionary <string, Price>())); }
/// <summary> /// Gets the product bulk prices. /// </summary> /// <param name="storefront">The storefront.</param> /// <param name="visitorContext">The visitor context.</param> /// <param name="catalogName">Name of the catalog.</param> /// <param name="productIds">The product ids.</param> /// <param name="priceTypeIds">The price type ids.</param> /// <returns> /// The manager response with the list of prices in the Result. /// </returns> public virtual ManagerResponse <Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult, IDictionary <string, Price> > GetProductBulkPrices([NotNull] CommerceStorefront storefront, [NotNull] VisitorContext visitorContext, string catalogName, IEnumerable <string> productIds, params string[] priceTypeIds) { Assert.ArgumentNotNull(storefront, "storefront"); if (priceTypeIds == null) { priceTypeIds = defaultPriceTypeIds; } var request = new RefSFArgs.GetProductBulkPricesRequest(catalogName, productIds, priceTypeIds); request.CurrencyCode = StorefrontManager.GetCustomerCurrency(); var result = this.PricingServiceProvider.GetProductBulkPrices(request); // Currently, both Categories and Products are passed in and are waiting for a fix to filter the categories out. Until then, this code is commented // out as it generates an unecessary Error event indicating the product cannot be found. // Helpers.LogSystemMessages(result.SystemMessages, result); return(new ManagerResponse <Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult, IDictionary <string, Price> >(result, result.Prices == null ? new Dictionary <string, Price>() : result.Prices)); }
/// <summary> /// Gets the product bulk prices. /// </summary> /// <param name="request">The request.</param> /// <returns>Returns product bulk prices.</returns> public virtual Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult GetProductBulkPrices(GetProductBulkPricesRequest request) { return this.RunPipeline<GetProductBulkPricesRequest, Sitecore.Commerce.Services.Prices.GetProductBulkPricesResult>("commerce.prices.getProductBulkPrices", request); }
/// <summary> /// Gets the product bulk prices. /// </summary> /// <param name="storefront">The storefront.</param> /// <param name="catalogName">Name of the catalog.</param> /// <param name="productIds">The product ids.</param> /// <param name="priceTypeIds">The price type ids.</param> /// <returns>The manager response with the list of prices in the Result.</returns> public virtual ManagerResponse<GetProductBulkPricesResult, IDictionary<string, Dictionary<string, Price>>> GetProductBulkPrices([NotNull] CommerceStorefront storefront, string catalogName, IEnumerable<string> productIds, params string[] priceTypeIds) { Assert.ArgumentNotNull(storefront, "storefront"); if (priceTypeIds == null) { priceTypeIds = defaultPriceTypeIds; } var request = new GetProductBulkPricesRequest(catalogName, productIds, priceTypeIds); var result = this.PricingServiceProvider.GetProductBulkPrices(request); // Currently, both Categories and Products are passed in and are waiting for a fix to filter the categories out. Until then, this code is commented // out as it generates an unecessary Error event indicating the product cannot be found. // Helpers.LogSystemMessages(result.SystemMessages, result); return new ManagerResponse<GetProductBulkPricesResult, IDictionary<string, Dictionary<string, Price>>>(result, result.Prices == null ? new Dictionary<string, Dictionary<string, Price>>() : result.Prices); }
/// <summary> /// Gets the product bulk prices. /// </summary> /// <param name="request">The request.</param> /// <returns>Returns product bulk prices.</returns> public virtual GetProductBulkPricesResult GetProductBulkPrices(GetProductBulkPricesRequest request) { return this.RunPipeline<GetProductBulkPricesRequest, GetProductBulkPricesResult>("commerce.prices.getProductBulkPrices", request); }