This pipelet creates an Order based on the specified Basket. If the order could be created successfully, it will be in status CREATED. The Basket will be removed from the session and marked for removal.
This pipelet ends on the ERROR exit if any of the following conditions are encountered:
- any of the totals (net, gross, tax) of the basket is N/A
- any of the product items is not available
- any of the product items represents a master product
- any of the product items is a product set
- any campaign-based coupon in the basket is invalid (see dw.order.CouponLineItem.isValid())
- the basket represents an order being edited, but the order has been already been replaced by another order
- the basket represents an order being edited, but the customer associated with the original order is not the same as the current customer
The pipelet removes all empty shipments of the basket before creating the order. A shipment is empty if
- it contains no product or gift certificate line items
- all total prices (net, gross, tax) are 0.0
The pipelet decrements inventory for all products contained in the order. It redeems all coupons contained in the order.
This pipelet must not be used with ReserveInventoryForOrder pipelet or dw.order.Basket#reserveInventory() in the same request.
If the basket contains product or gift certificate line items associated with product list items, the pipelet updates the purchase history of the product list items. For example, if the basket contains an item added from a gift registry, the purchase history of the respective gift registry item is updated.
Please note that this pipelet might result in an order with a different customer ID than the originating registered customer attached to the session. This happens if a registered customer logs in with the "RememberMe" flag set to true, but is later logged out (either explicitly, or automatically via session expiration) before calling this pipelet. This is due to the internal order creation logic, which creates a new guest customer and attaches it to the order in such cases. To avoid this situation, have your custom code verify that the customer is authenticated before it calls this pipelet.