Dynamicweb.eCommerce.Prices Namespace > Price Class : GetDoublePriceInfo Method |
class MyPage : System.Web.UI.Page { private Dynamicweb.eCommerce.Products.Product product; private void Page_Load(System.Object sender, System.EventArgs e) { product = (Dynamicweb.eCommerce.Products.Product)Session["Ecom.Backend.Product"]; } public Dynamicweb.eCommerce.Prices.PriceInfo GetCachedPrice(Dynamicweb.eCommerce.Discounts.Discount discount) { bool vatIncludedInDB = Base.ChkBoolean(Base.GetGs("/Globalsettings/Ecom/Price/PricesInDbIncludesVAT")); double productAmount = 0; if (vatIncludedInDB) { productAmount = product.Price.PriceWithVAT; } else { productAmount = product.Price.PriceWithoutVAT; } productAmount -= discount.get_Value(vatIncludedInDB, Discount.DiscountCalculationType.DiscountCalculationAmount, false); Dynamicweb.eCommerce.Prices.PriceInfo cachedPrice = Dynamicweb.eCommerce.Prices.Price.GetDoublePriceInfo(productAmount, Dynamicweb.eCommerce.Common.Context.Currency); return cachedPrice; } }
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