Try our conversational search powered by Generative AI!

Class SerializableCartProvider

This class is intended to be used internally by EPiServer. We do not support any backward compatibility on this. Please DO NOT use this in your project.

Handles loading and persistence for SerializableCart.

Inheritance
System.Object
SerializableCartProvider
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Commerce.Order.Internal
Assembly: EPiServer.Business.Commerce.dll
Version: 13.30.0
Syntax
public class SerializableCartProvider : ICartProvider, IOrderProvider<ICart>

Constructors

SerializableCartProvider(OperationKeysTransformer, SerializableCartDB, ServiceAccessor<SiteContext>, ICurrentMarket, IPurchaseOrderProvider, IPaymentPlanProvider, IOrderGroupFactory, IOrderNumberGenerator, ICouponUsage)

Declaration
[Obsolete("This constructor is no longer used, use constructor with IOrderGroupCalculator instead. Will remain at least until May 2019.")]
public SerializableCartProvider(OperationKeysTransformer operationKeysTransformer, SerializableCartDB serializableCartDB, ServiceAccessor<SiteContext> siteContextAccessor, ICurrentMarket currentMarket, IPurchaseOrderProvider purchaseOrderProvider, IPaymentPlanProvider paymentPlanProvider, IOrderGroupFactory orderGroupFactory, IOrderNumberGenerator orderNumberGenerator, ICouponUsage couponUsage)
Parameters
Type Name Description
OperationKeysTransformer operationKeysTransformer
SerializableCartDB serializableCartDB
EPiServer.ServiceLocation.ServiceAccessor<SiteContext> siteContextAccessor
ICurrentMarket currentMarket
IPurchaseOrderProvider purchaseOrderProvider
IPaymentPlanProvider paymentPlanProvider
IOrderGroupFactory orderGroupFactory
IOrderNumberGenerator orderNumberGenerator
ICouponUsage couponUsage

SerializableCartProvider(OperationKeysTransformer, SerializableCartDB, ServiceAccessor<SiteContext>, ICurrentMarket, IPurchaseOrderProvider, IPaymentPlanProvider, IOrderGroupFactory, IOrderNumberGenerator, ICouponUsage, IOrderGroupCalculator)

Creates an instance of SerializableCartProvider.

Declaration
public SerializableCartProvider(OperationKeysTransformer operationKeysTransformer, SerializableCartDB serializableCartDB, ServiceAccessor<SiteContext> siteContextAccessor, ICurrentMarket currentMarket, IPurchaseOrderProvider purchaseOrderProvider, IPaymentPlanProvider paymentPlanProvider, IOrderGroupFactory orderGroupFactory, IOrderNumberGenerator orderNumberGenerator, ICouponUsage couponUsage, IOrderGroupCalculator orderGroupCalculator)
Parameters
Type Name Description
OperationKeysTransformer operationKeysTransformer

The operation keys transformer.

SerializableCartDB serializableCartDB

The serializable cart database access.

EPiServer.ServiceLocation.ServiceAccessor<SiteContext> siteContextAccessor

The site context accessor.

ICurrentMarket currentMarket

The current market service.

IPurchaseOrderProvider purchaseOrderProvider

The purchase order provider.

IPaymentPlanProvider paymentPlanProvider

The payment plan provider.

IOrderGroupFactory orderGroupFactory

The factory for creating order group sub-objects.

IOrderNumberGenerator orderNumberGenerator

The order number generator.

ICouponUsage couponUsage

The coupon usage report service.

IOrderGroupCalculator orderGroupCalculator

The order group calculator.

Methods

Create(Guid, String)

Creates an ICart for a specific customer.

Declaration
public ICart Create(Guid customerId, string name)
Parameters
Type Name Description
System.Guid customerId

The customer id.

System.String name

The cart name.

Returns
Type Description
ICart

An ICart.

Delete(OrderReference)

Deletes a cart using its order link.

Declaration
public void Delete(OrderReference orderLink)
Parameters
Type Name Description
OrderReference orderLink

The order link.

Load(Guid, String)

Loads a collection of ICart by customer identifier and cart name.

Declaration
public IEnumerable<ICart> Load(Guid customerId, string name)
Parameters
Type Name Description
System.Guid customerId

The customer id.

System.String name

The name of the order. The name is not unique for each order, instead it's suppose to differentiate orders of the same type.

Returns
Type Description
System.Collections.Generic.IEnumerable<ICart>

The System.Collections.Generic.IEnumerable<T>.

Remarks

If the name is null or empty, it returns all carts of the customer.

Load(Int32)

Loads an ICart by its identifier.

Declaration
public ICart Load(int cartId)
Parameters
Type Name Description
System.Int32 cartId

The cart id.

Returns
Type Description
ICart

The ICart.

Save(ICart)

Saves an ICart.

Declaration
public OrderReference Save(ICart cart)
Parameters
Type Name Description
ICart cart

The cart.

Returns
Type Description
OrderReference

An OrderReference.

SaveAsPaymentPlan(ICart)

Saves an ICart as IPaymentPlan.

Declaration
public IPaymentPlan SaveAsPaymentPlan(ICart cart)
Parameters
Type Name Description
ICart cart

The cart.

Returns
Type Description
IPaymentPlan

An IPaymentPlan.

SaveAsPurchaseOrder(ICart)

Saves an ICart as IPurchaseOrder.

Declaration
public IPurchaseOrder SaveAsPurchaseOrder(ICart cart)
Parameters
Type Name Description
ICart cart

The cart.

Returns
Type Description
IPurchaseOrder

An IPurchaseOrder.

Implements

See Also