I find that PricingServiceProvider.GetProductPrices(request) return empty array for my new created products, but this function show listprice array for default imported commerce product. Here this it function:
public virtual ManagerResponse<GetProductPricesResult, IDictionary<string, Price>> GetProductPrices([NotNull] CommerceStorefront storefront, [NotNull] VisitorContext visitorContext, string catalogName, string productId, bool includeVariants, params string[] priceTypeIds)
{
Assert.ArgumentNotNull(storefront, "storefront");
if (priceTypeIds == null)
{
priceTypeIds = DefaultPriceTypeIds;
}
var request = new Sitecore.Commerce.Engine.Connect.Services.Prices.GetProductPricesRequest(catalogName, productId, priceTypeIds)
{
DateTime = this.GetCurrentDate()
};
if (Sitecore.Context.User.IsAuthenticated)
{
request.UserId = visitorContext.GetCustomerId();
}
request.IncludeVariantPrices = includeVariants;
request.CurrencyCode = StorefrontManager.GetCustomerCurrency();
var result = this.PricingServiceProvider.GetProductPrices(request);
Helpers.LogSystemMessages(result.SystemMessages, result);
return new ManagerResponse<GetProductPricesResult, IDictionary<string, Price>>(result, result.Prices ?? new Dictionary<string, Price>());
}
I should that I create new products with full fields include List Price in Sitecore commerce server backoffice, but when these products show in product detail page without list price.
Does someone know my problem ? thank all