Dynamicweb.eCommerce.Prices Namespace > DefaultPriceProvider Class : FindPrice Method |
class MyPage : System.Web.UI.Page { private Dynamicweb.eCommerce.Prices.PriceRawCollection GetPrice(ProductItemCollection items) { Dynamicweb.eCommerce.Prices.PriceRawCollection col = new Dynamicweb.eCommerce.Prices.PriceRawCollection(); Dynamicweb.eCommerce.Prices.DefaultPriceProvider dpp = new Dynamicweb.eCommerce.Prices.DefaultPriceProvider(); foreach (ProductItem Item in items) { object priceObj = dpp.FindPrice(Item.Products.getProductById(Item.DefaultProductID), Item.Quantity, "", Dynamicweb.eCommerce.Common.Context.Currency,,Dynamicweb.Frontend.Extranet ); if (priceObj != null) { if ((priceObj) is Dynamicweb.eCommerce.Prices.PriceRaw) { Dynamicweb.eCommerce.Prices.PriceRaw rawPrice = (Dynamicweb.eCommerce.Prices.PriceRaw)priceObj; col.Add(rawPrice); } } } return col; } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2