SAP Commerce Cloud: Re-Order
SAP Re-Order module allows customers to easily place a new order for the same or similar products that they have previously purchased from an ecommerce store. This module can help increase customer loyalty, retention and revenue by offering convenience and personalization.
Features
The Re-Order module lets a logged-in customer rebuild a past order into a fresh cart with a single click, instead of searching for each product again:
- One-click Reorder action on the order details page in My Account.
- Confirmation modal, so the cart is never replaced by accident.
- Per-product feedback — separate notifications for products that were added, are out of stock, are only partially available, or are no longer sold.
- A desired quantity tag on cart items when stock could not cover the originally ordered amount.
The Re-Order module is an additional feature layered on top of your existing ordering flow — it does not change how regular carts and checkout work.
How it works
Starting a re-order
The customer opens a past order in My Account → My orders → order details. The module adds a Reorder button to the actions aside on that page.

Confirming
Clicking Reorder opens a confirmation modal. Nothing happens to the cart until the customer confirms.

Re-ordering replaces the customer's current cart. On confirmation, the module creates a brand-new cart and makes it the active one — any items in the previous cart are left behind in the abandoned cart.
Adding the products
After confirmation, the module creates a new cart and adds every line item from the original order to it, at the current price, stock, and promotions — not the ones from the original order. Each product is processed individually, so one unavailable product never blocks the rest of the order.
Every product ends up in one of five outcomes, and the customer is notified about each group:
| Outcome | When it happens | What the customer sees |
|---|---|---|
| Added | Product added at the full ordered quantity | Success notification with the number of added products |
| Partially added | Stock covers only part of the ordered quantity | Warning notification + a desired quantity tag on the cart item |
| Out of stock | SAP reports InsufficientStockError | Error notification |
| No longer available | The SKU no longer exists in the catalog (UnknownIdentifierError) | Error notification |
| Failed | Any other error for that product | Generic error notification |

Partially available products
When a product could only be added in a smaller quantity than originally ordered, the cart page marks that product card with a desired quantity tag showing the amount the customer originally wanted, next to the quantity that actually made it into the cart. This way the customer can see at a glance which items need attention — for example, to lower their expectations, pick a substitute, or try again later when the product is back in stock.
The tag disappears once the customer manually changes the quantity of that item or removes it from the cart — at that point the customer has made a conscious decision about the item, so the reminder is no longer needed.
Good to know
- Re-order is available to logged-in customers only — it reads the order details of the currently viewed order.
- Products are re-added at today's prices and promotions; the original order's prices are not carried over.
- Desired quantities are kept in the browser's
localStorage(key:re-order-wantedQuantities), so the tags survive a page refresh but are per-browser, not per-account.
Installation
To get access to this module and installation assistance, please contact the Alokai sales team or reach out to your Customer Support Manager.
Frontend Implementation
No manual installation steps are required for Next.js. The
add-modulecommand automatically copies the necessary components and configures the SDK module.
The add-module command automatically copies a <ReOrderButton /> component and an updated <CartPageProductCard /> into your Nuxt project. These components handle the re-order modal, quantity tags, and cart integration out of the box.
If you need to customize the behavior, the copied components are located at:
storefront-unified-nuxt/components/ReOrderButton/— re-order button with confirmation modalstorefront-unified-nuxt/components/CartPageProductCard/— cart product card with desired quantity tag
API reference
The module registers a namespaced middleware extension (reOrder) with one method, exposed on the SDK as sdk.reorder.addReOrderCartLineItems. It creates a new cart, sets it as the active one, and adds the given products to it one by one:
const results = await sdk.reorder.addReOrderCartLineItems({
products: [
{ productId: '300310300', sku: '300310300', quantity: 2 },
{ productId: '300410208', sku: '300410208' }, // quantity defaults to 1
],
});The response groups the requested products by outcome, matching the table above:
{
success: [{ productId: '300310300', sku: '300310300', quantity: 2 }],
smallerQuantity: [], // added, but with less quantity than requested
noQuantity: [], // out of stock
notFound: [], // SKU no longer exists in the catalog
unknownError: [], // any other per-product failure
}Calling the method with an empty products array returns a 400 Bad Request error.
Customization
All customer-facing copy — the modal header and text, and every notification — lives in the ReOrder translation namespace, so you can adjust the wording per locale without touching the components.
On the storefront side, the module ships:
ConfirmationModal— the re-order confirmation dialog, opened via there-orderquery parameter.useReOrderProducts— reads the viewed order, triggers the re-order, maps the per-product results to notifications, and manages desired quantities.useAddReOrderCartLineItems— the mutation wrapper aroundsdk.reorder.addReOrderCartLineItemsthat refreshes the cart on success.- An extended cart product card that renders the desired quantity tag.
Upgrading to 2.0.0? If you are upgrading from a pre-2.0.0 version, review the 2.0.0 migration guide for platform-wide changes (Tailwind 4, Nuxt 4, Next.js 16, ESM-only middleware) that may affect your re-order setup.
With these steps, your Re-Order feature is now effectively integrated with SAP Commerce Cloud. You've just provided a practical solution for your customers who want a hassle-free and efficient reordering process!