public static Price GetDefaultPrice(this VariationContent variation, IMarket market = null) { return(variation.GetDefaultPriceMoney(market)); }
/// <summary> /// Gets the display price for the variation and market, including currency symbol. /// </summary> /// <param name="variation">The variation to retrieve price from.</param> /// <param name="market">The market to get price for. If null, the current market is used.</param> /// <returns></returns> public static string GetDisplayPrice(this VariationContent variation, IMarket market = null) { Price price = variation.GetDefaultPriceMoney(market); return(price != null?price.UnitPrice.ToString() : string.Empty); }
public static int GetDefaultPriceAmount(this VariationContent variation, IMarket market) { Price price = variation.GetDefaultPriceMoney(market); return(price != null?decimal.ToInt32(price.UnitPrice.Amount) : 0); }