Class OrderLineService
- Namespace
- Dynamicweb.Ecommerce.Orders
- Assembly
- Dynamicweb.Ecommerce.dll
public class OrderLineService
- Inheritance
-
OrderLineService
- Inherited Members
Methods
AddOrderLineCopy(Order, OrderLine, bool)
Adds a copy of the specified order line.
public void AddOrderLineCopy(Order order, OrderLine orderLineToCopy, bool doMerge)
Parameters
order
Order- The Order.
orderLineToCopy
OrderLine- The order line.
doMerge
bool- if set to
true
try to merge.
CanBeMerged(OrderLine, OrderLine)
Determines whether the
orderLine
can be merged with the another
order line.public bool CanBeMerged(OrderLine orderLine, OrderLine another)
Parameters
Returns
- bool
true
if theorderLine
can be merged withanother
order line; otherwise,false
.
ClearCachedPrices(OrderLine)
Clears the cached price.
public void ClearCachedPrices(OrderLine orderLine)
Parameters
orderLine
OrderLine- The Order line.
Create(Order, Product, double, StockUnit, PriceInfo)
public OrderLine Create(Order order, Product product, double quantity, StockUnit unit, PriceInfo unitPrice)
Parameters
order
Order- The Order.
product
Product- The Product.
quantity
double- The quantity.
unit
StockUnit- The stock uint.
unitPrice
PriceInfo- The unit price.
Returns
Create(Order, Product, double, StockUnit, PriceInfo, Currency, Country)
[Obsolete("Use Create(Order, Product, Double, StockUnit, PriceInfo) instead.")]
public OrderLine Create(Order order, Product product, double quantity, StockUnit unit, PriceInfo unitPrice, Currency currency, Country country)
Parameters
order
Order- The Order.
product
Product- The Product.
quantity
double- The quantity.
unit
StockUnit- The stock unit.
unitPrice
PriceInfo- The unit price.
currency
Currency- The currency.
country
Country- The country.
Returns
Create(Order, string, double, PriceInfo, OrderLineType, string, string)
Adds a new OrderLine to the OrderLineCollection of the Order with the given OrderLineType and the given text.
public OrderLine Create(Order order, string text, double quantity, PriceInfo unitPrice, OrderLineType type, string parentOrderLineId, string discountId)
Parameters
order
Order- The Order.
text
string- The line text.
quantity
double- The quantity.
unitPrice
PriceInfo- The unit price.
type
OrderLineType- The order line price.
parentOrderLineId
string- The parent order line ID.
discountId
string- The discount ID.
Returns
Create(Order, string, double, PriceInfo, OrderLineType, string, string, Currency)
Adds a new OrderLine to the OrderLineCollection of the Order with the given OrderLineType and the given text.
[Obsolete("Use Create(Order, String, Double, PriceInfo, OrderLineType, String, String) instead.")]
public OrderLine Create(Order order, string text, double quantity, PriceInfo unitPrice, OrderLineType type, string parentOrderLineId, string discountId, Currency currency)
Parameters
order
Order- The Order.
text
string- The line text.
quantity
double- The quantity.
unitPrice
PriceInfo- The unit price.
type
OrderLineType- The order line price.
parentOrderLineId
string- The parent order line ID.
discountId
string- The discount ID.
currency
Currency- The currency.
Returns
Delete(string)
Deletes the Order line from database.
public void Delete(string orderLineId)
Parameters
orderLineId
string- The Order line ID.
DeleteAll(string)
Deletes all order lines from database for a given order including discounts, etc..
public void DeleteAll(string orderId)
Parameters
orderId
string
GetById(string)
Gets the order line by ID.
public OrderLine GetById(string orderLineId)
Parameters
orderLineId
string- The Order line ID.
Returns
GetById(string, Currency)
Gets the order line by ID.
[Obsolete("Use GetById(String, Order) instead.")]
public OrderLine GetById(string orderLineId, Currency currency)
Parameters
Returns
GetById(string, Order)
Gets the order line by ID.
public OrderLine GetById(string orderLineId, Order order)
Parameters
Returns
GetByOrder(Order)
Gets the lines of the specified order.
public IEnumerable<OrderLine> GetByOrder(Order order)
Parameters
order
Order- The Order.
Returns
- IEnumerable<OrderLine>
- The collection of the OrderLine.
GetByOrder(Order, Currency)
Gets the lines of the specified order.
[Obsolete("Use GetByOrder(Order) instead.")]
public IEnumerable<OrderLine> GetByOrder(Order order, Currency currency)
Parameters
Returns
- IEnumerable<OrderLine>
- The collection of the OrderLine.
GetOrderLine(string)
Gets the order line by ID.
[Obsolete("Use GetById(String, Order) instead.")]
public OrderLine GetOrderLine(string orderLineId)
Parameters
orderLineId
string- The Order line ID.
Returns
GetOrderLines(Order)
Gets the lines of the specified order.
[Obsolete("Use 'GetByOrder' instead")]
public IEnumerable<OrderLine> GetOrderLines(Order order)
Parameters
order
Order- The Order.
Returns
- IEnumerable<OrderLine>
- The collection of the OrderLine.
GetOrderLineType(int)
Gets the OrderLineType of the OrderLine.
public OrderLineType GetOrderLineType(int orderLineType)
Parameters
orderLineType
int- The integer equivalent of OrderLineType.
Returns
GetOrderLineType(string)
Gets the OrderLineType of the OrderLine.
public OrderLineType GetOrderLineType(string orderLineType)
Parameters
orderLineType
string- The string equivalent of OrderLineType.
Returns
GetOrderLineUniqueKey(OrderLine)
public static string GetOrderLineUniqueKey(OrderLine orderLine)
Parameters
orderLine
OrderLine
Returns
GetProductImage(OrderLine, int?)
Returns the path to the product image.
public string GetProductImage(OrderLine orderLine, int? areaId)
Parameters
Returns
- string
- The path to the product image.
OrderLineBuilder(Order, OrderLineBuilderConfig)
Builds an OrderLine based on the given OrderLineBuilderConfig.
[Obsolete("Use Services.Carts.OrderLineBuilder(Order, OrderLineBuilderConfig) instead.")]
public OrderLine OrderLineBuilder(Order order, OrderLineBuilderConfig builderConfiguration)
Parameters
order
OrderbuilderConfiguration
OrderLineBuilderConfig- The builder configuration.
Returns
Save(OrderLine)
Saves the order line.
public void Save(OrderLine orderLine)
Parameters
orderLine
OrderLine- The Order line.
Save(string, IEnumerable<OrderLine>)
Saves the order lines.
public void Save(string orderId, IEnumerable<OrderLine> orderLines)
Parameters
orderId
string- The Order ID of the order lines.
orderLines
IEnumerable<OrderLine>- The Order lines.
SetProductInformation(OrderLine, Product)
Sets the product information.
Usually used for BOM products.
public void SetProductInformation(OrderLine orderLine, Product product)
Parameters
SetProductInformation(OrderLine, Product, string, string)
Sets the product information.
Usually used for BOM products.
[Obsolete("Use SetProductInformation(OrderLine, Product) instead.")]
public void SetProductInformation(OrderLine orderLine, Product product, string currencyCode, string vatCountryCode)
Parameters
orderLine
OrderLine- The Order line.
product
Product- The product.
currencyCode
string- The currency code.
vatCountryCode
string- The country code.
SetUnitPrice(OrderLine, PriceInfo)
Sets the unit price.
public void SetUnitPrice(OrderLine orderLine, PriceInfo priceInfo)
Parameters
SetUnitPrice(OrderLine, PriceInfo, bool)
Sets the unit price.
public void SetUnitPrice(OrderLine orderLine, PriceInfo priceInfo, bool forcePriceRecalculation)
Parameters
orderLine
OrderLine- The Order line.
priceInfo
PriceInfo- The unit price.
forcePriceRecalculation
bool- Determines whether the order line price should be recalculated.
SetUnitPrice(OrderLine, double)
Sets the unit price.
[Obsolete("Use SetUnitPrice(OrderLine, Double, Boolean) instead.")]
public void SetUnitPrice(OrderLine orderLine, double theUnitPrice)
Parameters
SetUnitPrice(OrderLine, double, bool)
Sets the unit price.
public void SetUnitPrice(OrderLine orderLine, double theUnitPrice, bool applyToCurrentProductSettings)
Parameters
orderLine
OrderLine- The Order line.
theUnitPrice
double- The unit price.
applyToCurrentProductSettings
bool- Determines whether price should be applied to the order line product.
SetUnitPrice(OrderLine, double, bool, Currency, Country)
Sets the unit price.
[Obsolete("Use SetUnitPrice(OrderLine, Double, Boolean) instead.")]
public void SetUnitPrice(OrderLine orderLine, double theUnitPrice, bool applyToCurrentProductSettings, Currency currency, Country country)