// Todo: Thanh.nq will enhance and support different currency in system private decimal GetPrice(Livis.Market.Data.Product product, CustomerGroup customerGroup, string currency) { if (string.IsNullOrEmpty(product.Prices)) { return(0); } // we are not only support get price base on customer group but also support base on currency such VND, EUR, USD, CAD, GBP // we will enhance this feature after finishing Livis Rose and Livis Market /// Now we will assume all price with currency : EUR var prices = JsonConvert.DeserializeObject <List <ProductPrice> >(product.Prices); return(prices.First(x => x.CustomerGroup == customerGroup).Price); }
private bool IsVariantIdMatch(Livis.Market.Data.Product product, string variantKey) { if (product.VariantKeys == null) { return(false); } var variants = JsonConvert.DeserializeObject <List <Variant> >(product.VariantKeys); if (variants == null) { return(false); } return(variants.Any(v => v.Id == variantKey)); }