Auto-Cancel Unpaid Orders
Automatically move unpaid orders to the Cancelled state after a configurable grace period, restoring reserved stock without any manual work.
Available since v1.0.3
Overview
When a customer places an order and chooses an offline payment method — bank transfer, wire payment, or any other method you have configured — that stock is held but no payment has arrived. If the customer never pays, those items remain unavailable for other buyers and your inventory figures become inaccurate.
The auto-cancel feature solves this by giving every unpaid order a deadline. Once the deadline passes, the cron job changes the order status to Cancelled, which triggers PrestaShop's standard cancellation pipeline: stock quantities are restored, the order history is updated, and the customer receives the standard cancellation confirmation email from PrestaShop.
There are two independent ways to trigger a cancellation, and they can coexist:
- Global deadline — a single number of days that applies to all unpaid orders for any payment method. Every order that exceeds this age is cancelled automatically regardless of which reminder messages you have set up.
- Per-message cancellation — a specific reminder message can be flagged as the "final notice." When the cron sends that message, it cancels the order immediately after sending the email. This approach gives you precise control over the exact moment an order is cancelled and allows you to send a custom final warning first.
You can use both methods at the same time. If a per-message cancellation fires before the global deadline is reached, the order is cancelled at that point and the global deadline never applies.
Configuration
Step 1: Enable the global cancel feature
- Go to Modules > Module Manager, find Order Payment Reminders Pro, and click Configure.
- Click the Global Settings tab.
- Set Activate Cancel Orders Feature to Yes.
- Enter a number in Cancel Order after (in days). For example, enter
10to cancel any unpaid order that is more than 10 days old. - Click Save.
If your store uses the PrestaShop Bank Wire module, the field description shows the recommended value from that module's Reservation period setting so you can keep both in sync.
Global Settings tab fields:
| Field | Values | Default | Description |
|---|---|---|---|
| Activate Cancel Orders Feature | Yes / No | No | Master switch for the auto-cancel system. No cancellations occur when this is off, even if per-message cancel flags are enabled. |
| Cancel Order after | Number (days) | 0 | How many days after the order is created before it is cancelled. A value of 0 disables the global deadline even when the feature is activated. |
Step 2: (Optional) Mark a reminder message as the cancellation trigger
If you want to send a custom "last chance" email at the moment of cancellation instead of (or as well as) using the global deadline:
- In the Reminder Messages tab, click Edit on the message you want to be the final notice, or create a new message at the appropriate schedule (for example, 9 days after order creation).
- Scroll down to the Advanced Options section within the message form.
- Set Cancel the order after this message to Yes.
- Save the message.
When the cron processes an order that has reached this message's scheduled time, it sends the email and then immediately cancels the order. The global deadline countdown still runs in parallel — whichever threshold is hit first takes effect.
Reminder message form — Advanced Options:
| Field | Values | Default | Description |
|---|---|---|---|
| Cancel the order after this message | Yes / No | No | When set to Yes, the cron cancels the order immediately after sending this reminder. The order status changes to Cancelled and stock is restored. |
Step 3: Verify the cron job is active
The auto-cancel logic only runs when the cron endpoint is called. If the cron is not set up, no cancellations will happen regardless of your settings.
- Go to the Cron Setup tab in the module.
- Copy the cron URL shown there (it contains your secure token).
- Add a daily server cron job that calls that URL, for example at midnight.
See the Cron Setup guide for detailed instructions.
Step 4: Test before going live
Before enabling auto-cancel on a production store:
- Go to Global Settings and enable Test Mode.
- Enter a test email address.
- Trigger the cron URL manually in your browser.
- The module prints a summary of what it would do — orders it would cancel appear as "Direct Cancel Order [id]" without actually changing their status.
- Once you are satisfied with the output, disable Test Mode.
How It Works
The global deadline
Each time the cron runs, the module fetches all unpaid orders for the payment methods you have configured messages for. For each order it calculates how many hours have elapsed since the order was created.
If Cancel Order after is set to a value greater than 0, the module converts that to hours (days × 24). Any order older than that threshold is cancelled immediately — no email is sent first by this path, and no reminder message needs to exist for the cancellation to happen.
The cancellation flow:
- PrestaShop's
OrderHistoryobject moves the order to the Cancelled order state. - PrestaShop's standard cancellation pipeline runs, which restores product stock quantities and, if the order state is configured to send an email, sends the default PrestaShop cancellation email to the customer.
- The order history entry is added with no employee attached — the module acts automatically.
- If the PrestaShop cancellation pipeline fails for any reason (for example, a compatibility issue on some PS 8 environments), the module falls back to a direct SQL status update so the order is still marked as cancelled even if stock restoration emails cannot fire.
Per-message cancellation
When the cron is processing an order that has reached a message's scheduled time and that message has Cancel the order after this message set to Yes:
- The module sends the reminder email to the customer first.
- After the email is sent (or attempted), it cancels the order using the same pipeline described above.
This gives the customer one final email explaining what is happening before the cancellation takes effect.
Interaction with test mode
When Test Mode is enabled:
- Orders that would be cancelled via the global deadline appear as "Direct Cancel Order [id] (reference)" in the cron output — they are not actually cancelled.
- Orders that would be cancelled via a per-message trigger appear as "Cancel Order [id] (reference)" — also not cancelled.
No real cancellations happen while test mode is active, so you can safely simulate a full cron run on a live store.
Interaction with the admin digest email
If you have enabled the Admin Digest Email in Global Settings, the digest runs at the start of every cron execution, before any cancellations or reminders are processed. It looks at the same unpaid order list and flags orders that are within your configured alert window of the cancellation deadline. This gives you a daily warning so you can intervene manually if needed.
For example, if your global deadline is 10 days and your digest alert is 24 hours, you receive an email each day listing orders that have been unpaid for 9 or more days — giving you one last chance to follow up with the customer before the system cancels automatically.
See Admin Digest Email for setup details.
Usage Examples
Example: Simple 14-day deadline
You accept bank wire payments and want to cancel any order not paid within 14 days to match your bank's reservation period.
- Set Activate Cancel Orders Feature to Yes.
- Set Cancel Order after to
14. - No per-message cancellation needed.
Every day when the cron runs, it cancels any unpaid order that is more than 14 days old. Stock is restored automatically.
Example: Escalating reminders with a final cancellation email
You want to send three reminders (day 3, day 7, day 10) and then cancel at day 10 with a personalised final email.
- Create three reminder messages: at 72 hours, 168 hours, and 240 hours.
- On the day-10 (240-hour) message, set Cancel the order after this message to Yes.
- Leave Cancel Order after set to
0(disabled), or set it higher than 10 as a safety net.
When the cron runs on day 10 for an unpaid order, it sends your custom final email and then cancels the order. If the cron is not called for several days and the order is past day 10, the global deadline acts as a backstop.
Example: Different deadlines by payment method
Bank wire orders should cancel at 7 days; a slower offline method should cancel at 14 days. Because the global deadline is a single value, use per-message cancellation to achieve this:
- Create a message for bank wire at 168 hours (7 days) with Cancel the order after this message set to Yes.
- Create a message for the other payment method at 336 hours (14 days) with Cancel the order after this message set to Yes.
- Set Cancel Order after to
0(disabled globally).
Each payment method follows its own timeline.
Important Notes
- The auto-cancel feature only affects orders that are still unpaid. Orders that have been paid — even partially — are not touched.
- Orders already in the Cancelled state are skipped; the module checks the current state before applying a second cancellation.
- The module does not send a separate cancellation email of its own. PrestaShop's standard cancellation email (configured under Orders > Statuses for the Cancelled state) is what the customer receives, if that state is configured to send one.
- When using the per-message cancellation on a multi-language store, the reminder email is sent in the customer's language before the cancellation happens.
- In a multi-shop setup, Cancel Order after (
wr_cancel_days) and the cancel-orders toggle (wr_cancel_orders) are global values that apply across all shops. Per-message cancel flags are stored per message and can be scoped to a specific payment module. - The Cancel Order after value is interpreted as whole days only. You cannot set a deadline of, for example, 7.5 days.
- There is no undo for an automatic cancellation. If an order is cancelled in error, you need to manually restore it in the Back Office.
Troubleshooting
| Problem | Solution |
|---|---|
| Orders are not being cancelled even though the deadline has passed | Check that Activate Cancel Orders Feature is set to Yes and Cancel Order after is greater than 0. Then confirm the cron job is running — open the cron URL directly in a browser and check the output for cancellation messages. |
| Orders are being cancelled too early | The age is calculated from the order creation date, not from the last reminder sent. If your cron runs at unpredictable intervals, an order created near midnight may appear older than expected. Verify the order's creation time in the Back Office. |
| Stock is not being restored after cancellation | Stock restoration is handled by PrestaShop's cancellation pipeline, not by this module. Check that the Cancelled order state is configured in Orders > Statuses with stock-restore settings enabled. On some older PS versions, stock restoration depends on whether the order was validated. |
| Customer did not receive a cancellation email | The module does not send its own cancellation email. The email is sent by PrestaShop only if the Cancelled order state has Send email to customer enabled under Orders > Statuses. Check that setting. |
| The per-message cancellation is firing but the order is not cancelled | If test mode is on, cancellations are simulated only. Disable test mode and re-run the cron. If the issue persists, check PrestaShop logs under Advanced Parameters > Logs for WireTransferReminder entries describing a failed cancellation. |
| Cron output shows "Direct Cancel Order" but nothing changes | This is the test mode output. It means the order would be cancelled but test mode is preventing it. Disable test mode in Global Settings. |
| The fallback SQL cancellation ran but stock was not restored | The direct SQL fallback only updates the order status row — it does not run PrestaShop's full cancellation pipeline. This is a last-resort path. To trigger proper stock restoration, manually change the order status in the Back Office, which fires the full pipeline. |
Frequently Asked Questions
Will cancelling an order via this module trigger the standard PrestaShop cancellation email to the customer?
Yes, if your Cancelled order state is configured to send an email under Orders > Statuses. The module uses PrestaShop's own order history pipeline, which respects that setting exactly as a manual cancellation would.
Can I set different cancellation deadlines for different payment methods?
The global deadline applies to all payment methods at once. To get per-payment-method deadlines, disable the global deadline (set it to 0) and instead use the per-message cancel option on a message tied to that specific payment method at the schedule that represents your deadline.
What happens if the cron does not run for several days and many orders pass the deadline at once?
All qualifying orders are cancelled on the next cron run. There is no batching limit, so if 50 orders have passed the deadline, all 50 are cancelled in that single run.
Does auto-cancel work on orders placed with payment methods other than bank wire?
Yes. Since version 1.2.0, the module supports any offline payment method. The cron fetches unpaid orders based on which payment modules you have created reminder messages for. If you have a message configured for a given payment module, its orders are included in the cancellation check.
If I use both the global deadline and a per-message cancel flag, which one fires first?
Whichever threshold the order reaches first. If the per-message schedule (for example, day 9) comes before the global deadline (day 14), the message is sent and the order is cancelled on day 9. The global deadline never fires for that order because it is already cancelled. If the per-message schedule is never reached (for example, the message was deleted), the global deadline acts as a safety net.
Can I see how many orders have been auto-cancelled in the dashboard?
The Recovery Statistics dashboard shows a "Total Cancelled" count for reminded orders that ended up in the Cancelled state. This includes both auto-cancelled orders and manually cancelled ones, as long as they had at least one reminder sent.
Does test mode protect my production orders from accidental cancellation?
Yes. When test mode is active, no orders are modified. The cron output describes what would happen — you can review it safely without affecting any order.
Is there a way to exclude specific orders from auto-cancellation?
Not through the module's interface. If you need to preserve a specific order, either process it manually (mark it as awaiting payment or contact the customer directly) or temporarily disable the feature, handle the order, then re-enable it.
Related Features
- Reminder Messages — create the per-message cancellation trigger and configure the final-notice email.
- Cron Setup — the auto-cancel feature only runs when the cron is active.
- Admin Digest Email — receive a daily warning before cancellations fire so you can intervene manually.
- Global Configuration — overview of all global settings including test mode.