OrderOptions
OrderOptions
Signature
interface OrderOptions {
orderItemsLimit?: number;
orderItemPriceCalculationStrategy?: OrderItemPriceCalculationStrategy;
process?: Array<CustomOrderProcess<any>>;
stockAllocationStrategy?: StockAllocationStrategy;
mergeStrategy?: OrderMergeStrategy;
checkoutMergeStrategy?: OrderMergeStrategy;
orderCodeStrategy?: OrderCodeStrategy;
}
Members
orderItemsLimit
number
999
The maximum number of individual items allowed in a single order. This option exists to prevent excessive resource usage when dealing with very large orders. For example, if an order contains a million items, then any operations on that order (modifying a quantity, adding or removing an item) will require Vendure to loop through all million items to perform price calculations against active promotions and taxes. This can have a significant performance impact for very large values.
Attempting to exceed this limit will cause Vendure to throw a {@link OrderItemsLimitError}.
orderItemPriceCalculationStrategy
process
stockAllocationStrategy
mergeStrategy
checkoutMergeStrategy
orderCodeStrategy
Allows a user-defined function to create Order codes. This can be useful when integrating with existing systems. By default, Vendure will generate a 16-character alphanumeric string.
Note: when using a custom function for Order codes, bear in mind the database limit for string types (e.g. 255 chars for a varchar field in MySQL), and also the need for codes to be unique.