Cart
Overview
Getting a cart
var cart = await _shoppingCartService.GetCartAsync(
customer: Services.WorkContext.CurrentCustomer,
cartType: ShoppingCartType.ShoppingCart,
storeId: Services.StoreContext.CurrentStore.Id);Adding items
var addToCartContext = new AddToCartContext
{
Customer = Services.WorkContext.CurrentCustomer,
Product = product,
CartType = ShoppingCartType.ShoppingCart,
Quantity = 1,
AutomaticallyAddRequiredProducts = true
};
var success = await _shoppingCartService.AddToCartAsync(addToCartContext);Updating or removing
Payment buttons
Migration and events
Related features
Last updated
Was this helpful?