Dynamicweb 8 Documentation
SetUnitPrice(PriceInfo) Method
Example 

The PriceInfo object. The property - UnitPrice.
Sets the unit price.
Syntax
'Declaration
 
Public Overloads Sub SetUnitPrice( _ 
   ByVal priceInfo As PriceInfo _ 
) 
public void SetUnitPrice( 
   PriceInfo priceInfo 
)

Parameters

priceInfo
The PriceInfo object. The property - UnitPrice.
Example
public class MyDiscountProvider: SalesDiscountProvider
{
 
	private OrderLine CreateOrderLine(Order order, PriceInfo priceInfo)
    {

       	//Add a new order line
       	OrderLine line = new OrderLine();
       	line.Order = order;
       	line.Quantity = 1;
       	line.ProductName = this.DiscountName;
       	line.SetUnitPrice(priceInfo.Multiply(-1));
       	line.ParentLineID = null;
       	line.DiscountID = DiscountID;

       	if (IsProductDiscount)
       		line.Type = Base.ChkString(Base.ChkNumber(OrderLine.OrderLineType.ProductDiscount));
       	else
       		line.Type = Base.ChkString(Base.ChkNumber(OrderLine.OrderLineType.Discount));

       	return line;
    }
 
}
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

OrderLine Class
OrderLine Members
Overload List

Send Feedback