Table of Contents

Class ProductReserve

Namespace
Dynamicweb.Ecommerce.Frontend.Cart
Assembly
Dynamicweb.Ecommerce.dll

It concerns for the reservation of products when they added to the basket.

public sealed class ProductReserve
Inheritance
ProductReserve
Inherited Members

Properties

Enabled

Gets a value indicating whether this ProductReserve is enabled.

public static bool Enabled { get; }

Property Value

bool

true if enabled; otherwise, false.

Mode

Gets the mode.

public static ProductReserveMode Mode { get; }

Property Value

ProductReserveMode

Methods

DecreaseReserve(Order, OrderLine)

Decreases the reserve.

public static void DecreaseReserve(Order order, OrderLine line)

Parameters

order Order

The order.

line OrderLine

The orderline

DecreaseReserve(Order?, string, string?, long, string?, double)

Decreases the reserve.

public static void DecreaseReserve(Order? order, string productId, string? variantId, long stockLocationId, string? unitId, double amount)

Parameters

order Order

The order.

productId string

The product identifier.

variantId string

The variant identifier.

stockLocationId long

The stock location id

unitId string

The unit id

amount double

The amount.

EnsureOrderIsReserved(Order)

Ensures the order is reserved.

public static void EnsureOrderIsReserved(Order order)

Parameters

order Order

The order.

GetReservedAmount(OrderLine)

Gets the reserved amount.

public static double GetReservedAmount(OrderLine line)

Parameters

line OrderLine

The orderline.

Returns

double

System.Double.

GetReservedAmount(string, string?, long, string?)

Gets the reserved amount.

public static double GetReservedAmount(string productId, string? variantId, long stockLocationId, string? unitId)

Parameters

productId string

The product identifier.

variantId string

The variant identifier.

stockLocationId long

The stock location id

unitId string

Returns

double

System.Double.

GetUnitReservedAmount(string, string?, long, string?, string?)

Gets the amount reserved for a unit, treating an empty unit as the default unit.

public static double GetUnitReservedAmount(string productId, string? variantId, long stockLocationId, string? unitId, string? defaultUnitId)

Parameters

productId string

The product identifier.

variantId string

The variant identifier.

stockLocationId long

The stock location id

unitId string

The unit id. An empty value means the default unit.

defaultUnitId string

The product's default unit id.

Returns

double

The reserved amount.

Remarks

Reservations are keyed on the raw order line unit id, so the default unit's stock can be reserved both under an empty unit id and under the default unit id. This sums both.

IncreaseReserve(Order, OrderLine)

Increases the reserve.

public static void IncreaseReserve(Order order, OrderLine line)

Parameters

order Order

The order.

line OrderLine

The orderline.

IncreaseReserve(Order, string, string?, long, string?, double)

Increases the reserve.

public static void IncreaseReserve(Order order, string productId, string? variantId, long stockLocationId, string? unitId, double amount)

Parameters

order Order

The order.

productId string

The product identifier.

variantId string

The variant identifier.

stockLocationId long

The stock location id

unitId string

The unit id

amount double

The amount.

PutOrderInReserve(Order)

Puts the order in reserve.

public static void PutOrderInReserve(Order order)

Parameters

order Order

The order.

RemoveUserStock(Order)

Removes the user stock.

public static void RemoveUserStock(Order order)

Parameters

order Order

The order.

ResetValues()

Resets the values.

public static void ResetValues()
To top