The reorder feature allows customers to streamline the process of repeating purchases. Based on a past order identifier, the cart is recreated and validated to be eligible for reordering.
Customers can use the following workflow to specify orders they want to reorder and complete the purchase.
1. Logged in customer clicks Orders on their personal menu.
2. Selects order they want to repurchase from the list.
3. On the order details site, customer clicks Reorder.
4. A new cart is created based on the past order identifier, and the availability of the products in the cart is validated.
5. Customer clicks Checkout.
6. The system pre-fills address, shipping method, and payment details using information from the past order.
7. The customer is redirected to Payment and summary section where they can edit the specified address and the payment method by clicking steps on the workflow timeline.
8. The customer pays for the order and completes the workflow.
You can modify workflow under the
framework.workflows configuration key.
Each workflow definition consists of a series of steps as well as a series of transitions between the steps.
Below example shows how to set up
can_be_reordered flag for specific order statuses.
1 2 3 4 5 6 7 8 9 10 11 12
Reorder PHP API¶
You can manage and modify reorder with a dedicated checkout and cart PHP API.
Checkout PHP API¶
Reorder comes with the dedicated
It contains helper methods and facades added over existing API to ease the order manipulation process.
The following methods can be used to modify the reorder flow to fit your business needs:
Allows you to add items from a previous order to a cart. It uses historical data from previously ordered items even if they are no longer available. Those items are validated against available stock. The method uses the following parameters:
$order(OrderInterface) - the source order from which items are added to the cart
$reorderCart(CartInterface) - the shopping cart to which items are added
CartInterface- the modified shopping cart containing the items from the order
Copies context information from a source order to a target checkout. This can include additional information or settings associated with the source order, for example, address. The method uses the following parameters:
$sourceOrder(OrderInterface) - the source order from which context is copied
$targetCheckout(CheckoutInterface) - the target checkout to which context is copied
Creates a new shopping cart for reordering items from a past order in the same currency. The method uses the following parameters:
$order(OrderInterface) - the order for which a reorder cart is being created
$newCartName(optional string) - an optional name for the new cart
CartInterface- the newly created shopping cart
Checks if a given order can be reordered. It evaluates criteria such as the order's status to determine reorder eligibility. The method uses the following parameters:
$order(OrderInterface) - reorder eligibility
bool- true if the order can be reordered, otherwise, false
For more information on how to modify checkout, see Checkout API documentation.
Cart PHP API¶
Reorder also facilitates
For more information on it, see Cart API documentation.