Class CartService
- Namespace
- Dynamicweb.Ecommerce.Frontend.Cart
- Assembly
- Dynamicweb.Ecommerce.dll
public class CartService
- Inheritance
-
CartService
- Inherited Members
Methods
AddOrderLine(Order, string, string, bool, bool, string, int, ref OrderLineCollection)
public OrderLine AddOrderLine(Order cart, string postfix, string orderLineType, bool quantityCheck, bool addToCart, string productUrl, int pageId, ref OrderLineCollection newOrderLines)
Parameters
cart
Orderpostfix
stringorderLineType
stringquantityCheck
booladdToCart
boolproductUrl
stringpageId
intnewOrderLines
OrderLineCollection
Returns
AddOrderLine(string, string, bool, bool, string, int, ref OrderLineCollection)
[Obsolete("Use the AddOrderLine method that accepts a cart instead")]
public OrderLine AddOrderLine(string postfix, string orderLineType, bool quantityCheck, bool addToCart, string productUrl, int pageId, ref OrderLineCollection newOrderLines)
Parameters
postfix
stringorderLineType
stringquantityCheck
booladdToCart
boolproductUrl
stringpageId
intnewOrderLines
OrderLineCollection
Returns
AddProducts(IEnumerable<CartProductInfo>, int?)
public void AddProducts(IEnumerable<CartProductInfo> products, int? favoriteListId = 0)
Parameters
products
IEnumerable<CartProductInfo>favoriteListId
int?
CartIsPresent()
Checks whether the cart exists or not. In session or in cookie.
public bool CartIsPresent()
Returns
- bool
true
if XXXX,false
otherwise.
ClearCart()
public void ClearCart()
CopyCustomerFieldsToDelivery(Order)
public void CopyCustomerFieldsToDelivery(Order order)
Parameters
order
Order
CreateCartLineFromModel(Order, OrderLineViewModel)
public OrderLine CreateCartLineFromModel(Order cart, OrderLineViewModel cartItem)
Parameters
cart
OrdercartItem
OrderLineViewModel
Returns
CreateOrder(Order)
Convert a cart into an order and finish it up.
public void CreateOrder(Order order)
Parameters
order
Order- The Order.
Empty()
public void Empty()
LoadCart()
Loads the cart into session. Checks for cart on AccessUser and cookie.
public void LoadCart()
LoadCart(int)
Loads the cart into session. Checks for cart on AccessUser and cookie.
public void LoadCart(int userId)
Parameters
userId
int
OrderLineBuilder(Order, OrderLineBuilderConfig)
Builds an OrderLine based on the given OrderLineBuilderConfig.
public OrderLine OrderLineBuilder(Order order, OrderLineBuilderConfig builderConfiguration)
Parameters
order
OrderbuilderConfiguration
OrderLineBuilderConfig- The builder configuration.
Returns
RemoveOrderLine(Order, string)
public void RemoveOrderLine(Order cart, string orderlineId)
Parameters
SaveCart()
public void SaveCart()
SetActiveCartOnUser(Order)
public void SetActiveCartOnUser(Order order)
Parameters
order
Order
SetActiveCartOnuser(Order, User)
public void SetActiveCartOnuser(Order order, User user)
Parameters
SetUserCart(Order, User, bool)
public void SetUserCart(Order order, User user, bool isNew)
Parameters
SetUserCart(Order, bool)
public void SetUserCart(Order order, bool isNew)
Parameters
UpdateCartFromModel(Order, OrderViewModel)
public void UpdateCartFromModel(Order cart, OrderViewModel cartModel)
Parameters
cart
OrdercartModel
OrderViewModel
UpdateCartLineFromModel(OrderLine, OrderLineViewModel)
public void UpdateCartLineFromModel(OrderLine orderLine, OrderLineViewModel cartItem)
Parameters
orderLine
OrderLinecartItem
OrderLineViewModel
UpdateOrderLines()
public void UpdateOrderLines()