Table of Contents

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 Order
postfix string
orderLineType string
quantityCheck bool
addToCart bool
productUrl string
pageId int
newOrderLines OrderLineCollection

Returns

OrderLine

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 Order
cartItem OrderLineViewModel

Returns

OrderLine

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 Order

The Order.

Empty()

public void Empty()

GetActiveCartId(int)

Gets the latest active cart id by user id.

public string GetActiveCartId(int userId)

Parameters

userId int

User id.

Returns

string

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 Order
builderConfiguration OrderLineBuilderConfig

The builder configuration.

Returns

OrderLine

The OrderLine.

RemoveOrderLine(Order, string)

public void RemoveOrderLine(Order cart, string orderlineId)

Parameters

cart Order
orderlineId string

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

order Order
user User

SetUserCart(Order, User, bool)

public void SetUserCart(Order order, User user, bool isNew)

Parameters

order Order
user User
isNew bool

SetUserCart(Order, bool)

public void SetUserCart(Order order, bool isNew)

Parameters

order Order
isNew bool

UpdateCartFromModel(Order, OrderViewModel)

public void UpdateCartFromModel(Order cart, OrderViewModel cartModel)

Parameters

cart Order
cartModel OrderViewModel

UpdateCartLineFromModel(OrderLine, OrderLineViewModel)

public void UpdateCartLineFromModel(OrderLine orderLine, OrderLineViewModel cartItem)

Parameters

orderLine OrderLine
cartItem OrderLineViewModel

UpdateOrderLines()

public void UpdateOrderLines()
To top