With the new SalePriceType in place I now need to be able to create prices in code associated with this price type. The code to save a price requires creating a PriceDetailValue with a CustomerPricing object:
// Set Price Detail value for Catalog Entry.
var priceDetailValue = new PriceDetailValue
{
CatalogKey = new CatalogKey(catalogEntry),
MarketId = new MarketId("US"),
CustomerPricing = new
CustomerPricing(CustomerPricing.PriceType.UserName,
accountId),
ValidFrom = DateTime.UtcNow.AddDays(-7),
ValidUntil = DateTime.UtcNow.AddDays(7),
MinQuantity = 0m,
UnitPrice = new Money(100m, Currency.USD)
};
The problem is I can't figure out how to create a new CustomerPricing with the PriceTypeId of my custom PriceType as the CustomerPricing uses an enum for PriceType.
Hi,
I'm implementing a tiered pricing model for organizations following Shannon's blog here: https://world.episerver.com/blogs/Shannon-Gray/Dates/2012/7/Creating-tiered-pricing-for-organizations-and-visitor-groups/
I've added the custom SalePriceType:
With the new SalePriceType in place I now need to be able to create prices in code associated with this price type. The code to save a price requires creating a PriceDetailValue with a CustomerPricing object:
The problem is I can't figure out how to create a new CustomerPricing with the PriceTypeId of my custom PriceType as the CustomerPricing uses an enum for PriceType.
Any ideas?