High-throughput order processing
You can optimize the order placement and checkout experience by configuring the following set of modules for high-throughput order processing:
- AsyncOrder—Asynchronously processes orders using a queue.
- NegotiableQuoteAsyncOrder—Asynchronously processes NegotiableQuote save order items.
- DeferredTotalCalculation—Defers calculations for order totals until checkout begins.
All features work independently. You can use all the features simultaneously or enable and disable features in any combination.
Use the command-line interface to enable these features, or edit the app/etc/env.php
file according to the corresponding README files defined in the Module Reference Guide.
Asynchronous order placement
The Async Order module enables asynchronous order placement, which marks the order as received
, places the order in a queue, and processes orders from the queue on a first-in-first-out basis. AsyncOrder is disabled by default.
For example, a customer adds a product to their shopping cart and selects Proceed to Checkout. They fill out the Shipping Address form, select their preferred Shipping Method, select a payment method, and place the order. The shopping cart is cleared, the order is marked as Received, but the Product quantity is not adjusted yet, nor is a sales email sent to the customer. The order is received, but the order details are not yet available because the order has not been fully processed. It remains in the queue until the placeOrderProcess
consumer begins, verifies the order with the inventory check feature (enabled by default), and updates the order as follows:
- Product available—the order status changes to Pending, the product quantity is adjusted, an email with order details is sent to the customer, and the successful order details become available for viewing in the Orders and Returns list with actionable options, such as reorder.
- Product out of stock or low supply—the order status changes to Rejected, the Product quantity is not adjusted, an email with order details about the issue is sent to the customer, and the rejected order details become available in the Orders and Returns list with no actionable options.
To enable AsyncOrder:
You can enable AsyncOrder using the command-line interface:
1
bin/magento setup:config:set --checkout-async 1
The set
command writes the following to the app/etc/env.php
file:
1
2
3
4
...
'checkout' => [
'async' => 1
]
See AsyncOrder in the Module Reference Guide.
To disable AsyncOrder:
Before disabling the AsyncOrder module, you must verify that all asynchronous order processes are complete.
You can disable AsyncOrder using the command-line interface:
1
bin/magento setup:config:set --checkout-async 0
The set
command writes the following to the app/etc/env.php
file:
1
2
3
4
...
'checkout' => [
'async' => 0
]
AsyncOrder compatibility
AsyncOrder supports a limited set of Commerce features.
Category | Supported Feature |
---|---|
Checkout types | OnePage Checkout Standard Checkout B2B Negotiable Quote |
Payment methods | Check/Money Order Cash on Delivery Braintree PayPal PayFlow Pro |
Shipping methods | All shipping methods are supported. |
The following features are not supported by AsyncOrder, but continue to work synchronously:
- Payment Methods not included in the supported feature list
- Multi Address Checkout
- Admin Order Creation
Web API support
When the AsyncOrder module is enabled, the following REST endpoints and GraphQL mutations run asynchronously:
REST:
POST /V1/carts/mine/payment-information
POST /V1/guest-carts/:cartId/payment-information
POST /V1/negotiable-carts/:cartId/payment-information
GraphQL:
GraphQL does not support placing negotiable quote orders asynchronously.
Excluding payment methods
Developers can explicitly exclude certain payments methods from Asynchronous Order placement by adding them to the Magento\AsyncOrder\Model\OrderManagement::paymentMethods
array. Orders that use excluded payment methods are processed synchronously.
Negotiable Quote Async Order
The Negotiable Quote Async Order B2B module enables you to save order items asynchronously for the NegotiableQuote
functionality. You must have AsyncOrder and NegotiableQuote enabled.
Deferred Total Calculation
The Deferred Total Calculation module optimizes the checkout process by deferring the total calculation until it is requested for the shopping cart or during final checkout steps. When enabled, only the subtotal calculates as a customer adds products to the shopping cart.
DeferredTotalCalculation is disabled by default.
To enable DeferredTotalCalculation:
You can enable DeferredTotalCalculation using the command-line interface:
1
bin/magento setup:config:set --deferred-total-calculating 1
The set
command writes the following to the app/etc/env.php
file:
1
2
3
4
...
'checkout' => [
'deferred_total_calculating' => 1
]
To disable DeferredTotalCalculation:
You can disable DeferredTotalCalculation using the command-line interface:
1
bin/magento setup:config:set --deferred-total-calculating 0
The set
command writes the following to the app/etc/env.php
file:
1
2
3
4
...
'checkout' => [
'deferred_total_calculating' => 0
]
See DeferredTotalCalculating in the Module Reference Guide.
Fixed Product Tax
When DeferredTotalCalculation is enabled, the Fixed Product Tax (FPT) is not included in the product price and cart subtotal of the mini cart after adding the product to the shopping cart. The FPT calculation is deferred when adding a product to the mini cart. The FPT displays correctly in the shopping cart after proceeding to final checkout.
Disable Inventory check
The Enable Inventory On Cart Load global setting determines whether to perform an inventory check when loading a product in the cart. Disabling the inventory check process improves performance for all checkout steps, particularly when dealing with bulk products in the cart.
When disabled, inventory check does not occur when adding a product to the shopping cart. If this inventory check is skipped, some out-of-stock scenarios could throw other types of errors. An inventory check always occurs at the order placement step, even when disabled.
Enable Inventory On Cart Load is enabled by default.
To disable the inventory check when loading the cart, set Enable Inventory Check On Cart Load to No
in the Admin UI. See Configure Global Options and Catalog Inventory in the User Guide.