Dynamicweb 8 Documentation
GetDoublePriceInfo Method
Example 

The price.
The currency.
Gets the double price info.
Syntax
'Declaration
 
Public Shared Function GetDoublePriceInfo( _ 
   ByVal Price As Double, _ 
   ByVal Curr As Currency _ 
) As PriceInfo
public static PriceInfo GetDoublePriceInfo( 
   double Price,
   Currency Curr 
)

Parameters

Price
The price.
Curr
The currency.
Example
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;
    }
}
Requirements

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

See Also

Reference

Price Class
Price Members

Send Feedback