Dynamicweb 8 Documentation
PriceRaw Class
Members  Example 

Represents a placeholder for an amount and a currency. PriceRaw is a simple unqualified price, that's mostly used internally by the PriceManager or by PriceProviders. A PriceRaw have no indicators to tell if VAT is included or if rounding have been perfomed. If you need to work with qualified prices, use PriceInfo.
Object Model
PriceRaw ClassCurrency Class
Syntax
'Declaration
 
<SerializableAttribute()> 
Public Class PriceRaw 
[SerializableAttribute()] 
public class PriceRaw 
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"];
    }

    private Dynamicweb.eCommerce.Prices.PriceInfo GetPrice(ProductItemCollection items)
    {
        Dynamicweb.eCommerce.Prices.PriceInfo priceInfo = new Dynamicweb.eCommerce.Prices.PriceInfo();

        if (product.Type == ProductType.Stock & product.PriceType == ProductPriceType.Calculated)
        {
            product.PriceType = ProductPriceType.FixedPrice;
        }

        if (product.Type == ProductType.Service & product.PriceType == ProductPriceType.Calculated)
        {
            product.PriceType = ProductPriceType.FixedPrice;
        }

        if (product.PriceType == ProductPriceType.Calculated | product.PriceType == ProductPriceType.CalculatedWithBase)
        {
            foreach (ProductItem Item in items)
            {
                object priceObj = Dynamicweb.eCommerce.Prices.PriceManager.FindPrice(Item.Products.getProductById(Item.DefaultProductID), Item.Quantity);

                if (priceObj != null)
                {
                    double quantity = 1.0;
                    if (Item.Quantity > 0)
                    {
                        quantity = Item.Quantity;
                    }

                    Dynamicweb.eCommerce.Prices.PriceInfo subPrice = null;

                    if ((priceObj) is Dynamicweb.eCommerce.Prices.PriceInfo)
                    {
                        subPrice = (Dynamicweb.eCommerce.Prices.PriceInfo)priceObj;
                    }
                    else if ((priceObj) is Dynamicweb.eCommerce.Prices.PriceRaw)
                    {
                        Dynamicweb.eCommerce.Prices.PriceRaw rawPrice = (Dynamicweb.eCommerce.Prices.PriceRaw)priceObj;
                        subPrice = new Dynamicweb.eCommerce.Prices.PriceCalculated(Item.Products.getProductById(Item.DefaultProductID), rawPrice);
                    }
                    subPrice = subPrice.Multiply(quantity);
                    priceInfo = priceInfo.Add(subPrice);
                }
            }

            if (product.PriceType == ProductPriceType.CalculatedWithBase)
            {
                priceInfo = priceInfo.Add(new Dynamicweb.eCommerce.Prices.PriceCalculated(product));
            }
        }
        else
        {
            priceInfo = new Dynamicweb.eCommerce.Prices.PriceCalculated(product);
        }

        return priceInfo;
    }
}
Inheritance Hierarchy

System.Object
   Dynamicweb.eCommerce.Prices.PriceRaw

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

PriceRaw Members
Dynamicweb.eCommerce.Prices Namespace

Send Feedback