Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Quick Order Data & Events

The Quick Order drop-in uses the event bus to coordinate containers (QuickOrderCsvUpload, QuickOrderItems, QuickOrderMultipleSku) and to integrate with the Cart drop-in. Events coordinate adding items, loading states, and add-to-cart success or error handling.

EventDirectionDescription
quick-order/add-itemsEmits and listensItems added via CSV upload, multiple SKU entry, or Quick Order search within QuickOrderItems. Payload: SubmitSkuValue (array of { sku, quantity }). Triggers product fetch and list update in QuickOrderItems.
quick-order/loadingEmits and listensLoading state changed. Payload: boolean. Disables inputs and shows loading indicators while processing.
quick-order/add-to-cartEmitsRequest to add items to cart when no custom handleAddToCart is used. Payload: array of cart item values. Default cart handler processes items.
quick-order/add-to-cart-errorEmitsAdd-to-cart operation failed. Payload: { message: string }. Shows error notification.
cart/product/addedListensProducts added to cart successfully. Payload: any[]. Quick Order shows success notification.

QuickOrderCsvUpload and QuickOrderMultipleSku emit this when the user adds items via CSV or the SKU text area. QuickOrderItems also emits it when the user adds a product via the integrated search (autocomplete). QuickOrderItems listens, fetches product data, and updates the list.

type SubmitSkuValue = Array<{ sku: string; quantity: number }>;
  • After CSV file is validated and parsed (QuickOrderCsvUpload)
  • After user clicks “Add to List” in QuickOrderMultipleSku with parsed SKUs
  • When user selects a product from the search autocomplete in QuickOrderItems
import { events } from '@dropins/tools/event-bus.js';
events.on('quick-order/add-items', (payload) => {
console.log('Items to add:', payload); // SubmitSkuValue
});

Containers emit this when a loading state starts or ends (for example, while fetching products or adding to cart).

boolean
import { events } from '@dropins/tools/event-bus.js';
events.on('quick-order/loading', (isLoading) => {
console.log('Quick Order loading:', isLoading);
});

QuickOrderItems emits this when the user clicks “Add All to Cart” and no custom handleAddToCart is provided. A default handler may listen and call the Cart API.

any[] // Cart item values (sku, quantity, options, and so on)

QuickOrderItems emits this when add-to-cart fails (backend error or custom handler returns an error message string).

{ message: string }
import { events } from '@dropins/tools/event-bus.js';
events.on('quick-order/add-to-cart-error', ({ message }) => {
console.error('Add to cart failed:', message);
});

The Cart drop-in emits this when products are added to the cart. Quick Order listens and shows a success notification.

any[]

QuickOrderItems emits PDP-scoped events to enable reuse of PDP containers (for example, ProductPrice, ProductOptions) within the Quick Order interface:

EventPayloadDescription
{scope}/pdp/dataOrderItemScoped event for product data updates per item.
{scope}/pdp/valuesoption valuesCaptures selected product options for configurable products.

These events are used internally by the slot system and typically do not require custom handling.

The QuickOrderVariantsGrid container (Grid Ordering on PDP) uses these events:

EventDirectionDescription
quick-order/grid-ordering-variantsEmitted externally (integration layer)Provides variant data to QuickOrderVariantsGrid. Payload: array of product variants. Typically emitted after variants are fetched on the PDP. Not required if initialVariants prop is used.
quick-order/grid-ordering-selected-variantsEmitted by QuickOrderVariantsGridNotifies when selected variants or quantities change. Payload: array of selected variants (quantity > 0) with enriched data (sku, attributes, price, quantity, subtotal). Captured by PDP integration for bulk add-to-cart. Emissions are debounced.
quick-order/grid-ordering-reset-selected-variantsEmitted externallyResets current grid selection (clears all quantities). Typically used after successful add-to-cart.

All Quick Order events use the centralized event bus:

import { events } from '@dropins/tools/event-bus.js';
events.on('quick-order/add-items', handleAddItems);
events.on('quick-order/loading', handleLoading);
events.on('quick-order/add-to-cart-error', handleAddToCartError);
events.on('cart/product/added', handleCartProductAdded);
// Clean up when needed
events.off('quick-order/add-items', handleAddItems);