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
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.
CheckoutStart(Order)
public void CheckoutStart(Order order)
Parameters
order
Order
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.
- Upgrade cart to order
- Set order complete and handle stock
- Set checkout done and removes stock reserve, handles taxes, handles gift card (use and buy), handle loyalty points (use and earn)
public void CreateOrder(Order order)
Parameters
order
OrderThe Order.
Empty()
public void Empty()
GetActiveCartId(int)
Gets the latest active cart id by user id.
public string GetActiveCartId(int userId)
Parameters
userId
intUser id.
Returns
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
OrderLineBuilderConfigThe 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()