Dynamicweb 8 Documentation
FindPrice Method (DefaultPriceProvider)
Example 

The product.
The quantity.
The variant ID.
The currency.
The unit ID.
The user.
Finds the price.
Syntax
'Declaration
 
Public Overrides Function FindPrice( _ 
   ByVal Product As Product, _ 
   ByVal Quantity As Double, _ 
   ByVal VariantID As String, _ 
   ByVal Currency As Currency, _ 
   ByVal UnitID As String, _ 
   ByVal User As Extranet _ 
) As PriceRaw
public override PriceRaw FindPrice( 
   Product Product,
   double Quantity,
   string VariantID,
   Currency Currency,
   string UnitID,
   Extranet User 
)

Parameters

Product
The product.
Quantity
The quantity.
VariantID
The variant ID.
Currency
The currency.
UnitID
The unit ID.
User
The user.
Example
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;
    }
}
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

DefaultPriceProvider Class
DefaultPriceProvider Members
Base Implementation in FindPrice

Send Feedback