Hey,
I have create a price provider that gives a discount of 50% on all products to all loged in users.
public class UserDiscountPriceProvider : PriceProvider { public override PriceRaw FindPrice(Product product, double quantity, string variantId, Currency currency, string unitId, User user) { PriceRaw priceRaw = null; if (user != null) { var defaultPriceProvider = new DefaultPriceProvider(); var defaultPrice = defaultPriceProvider.FindPrice(product, quantity, variantId, currency, unitId, user); priceRaw = new PriceRaw(defaultPrice.Price * 0.5, currency); } return priceRaw; } }
When rendering my Product page the price shows up correct with 50% off.
But prices inside the Product.Prices loop still show with the original price. Shouldn't a Price provider also run for prices in the price matrix? Or is there a different provider for that? Or am i doing it wrong entirely :)