Dynamicweb 8 Documentation
Add(IPriceInfo) Method
Example 

The price information.
Adds the specified price information.
Syntax
'Declaration
 
Public Overloads Overridable Function Add( _ 
   ByVal info As IPriceInfo _ 
) As PriceInfo
public virtual PriceInfo Add( 
   IPriceInfo info 
)

Parameters

info
The price information.
Example
class MyPage : System.Web.UI.Page
{
    private Dynamicweb.eCommerce.Prices.PriceInfo GetPriceInfo(double priceWithVAT, double priceWithoutVAT, double VATPercent)
    {
        Dynamicweb.eCommerce.Prices.PriceInfo info = new Dynamicweb.eCommerce.Prices.PriceInfo();
        info.Currency = Dynamicweb.eCommerce.Common.Context.Currency;

        Dynamicweb.eCommerce.Prices.PriceRaw rp = new Dynamicweb.eCommerce.Prices.PriceRaw();
        rp.Price = priceWithoutVAT;
        rp.Currency = Dynamicweb.eCommerce.Common.Context.Currency;

        Dynamicweb.eCommerce.Prices.PriceCalculated cp = new Dynamicweb.eCommerce.Prices.PriceCalculated();
        cp.PriceRaw = rp;

        cp.PriceWithoutVAT = priceWithoutVAT;
        cp.PriceWithVAT = priceWithVAT;
        cp.VATPercent = VATPercent;
        cp.VAT = priceWithVAT - priceWithoutVAT;

        return info.Add(cp);
    }
}
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

PriceInfo Class
PriceInfo Members
Overload List

Send Feedback