
Order Archive for OpenCart — archive old orders without losing their history
A module for OpenCart 4, 3 and 2.3 that moves old completed orders out of the working tables into a separate archive. The admin order list and search get lighter, while the customer still sees all his orders in the account, reports still count archived orders and the order page opens as before. Any change to an archived order first brings it back to the store. No core edits and no OCMOD.
- Compatibility
- OpenCart 4.0.2 – 4.1.x (tested on 4.1.0.3 and 4.0.2.3, including DB_DRIVER=pdo) · OpenCart 3.0.x (tested on 3.0.5.0) · OpenCart 2.3.0.2 (PHP 7.0) · works next to CatCode modules: Nova Poshta Premium, Multi PRRO, KeyCRM / SalesDrive / KeepinCRM Sync, Returns & Exchanges, One Page Checkout, Payment Status Sync · MariaDB 10.11
- Version
-
v1.0.0 (OpenCart 4)
v1.0.0 (OpenCart 3.x)
v1.0.0 (OpenCart 2.3) - Licence
- one site, lifetime
- Trial
- 7 days, no card, one per site
What Free has,
and what Pro adds
The free version works with no time limit. Pro adds the rest of the features in the table.
What it looks like
Key points
What the customer sees
Nothing changes for the customer. He opens “Order History” and sees all his orders — new ones and three-year-old ones — in one list, in the same order and with the same pages.
What the admin gets
An “Order archive” item in the “Sales” menu with three tabs.

The trial starts when you ask
A fresh install is the free version, nothing switches on by itself. The “Try Pro for 7 days” button → e-mail → the key right in the window and by e-mail.

One key — one site
Moving the store? Unbind the licence on the old domain and activate it on the new one yourself. For studios — keys for 5 or 25 sites, or unlimited.
Technical requirements
OpenCart 4.0.2 – 4.1.x (tested on 4.1.0.3 and 4.0.2.3, with the mysqli and pdo database drivers), 3.0.x (tested on 3.0.5.0) or 2.3.0.2.
PHP — whatever your OpenCart version needs: the 2.3 build was tested on PHP 7.0, the others on PHP 8.1–8.3. The cURL extension is needed for the Pro licence.
Database: tested on MariaDB 10.11 with InnoDB tables.
Schedule (Pro): in OpenCart 4 — the standard scheduler (Extensions > Cron Jobs) or hosting cron; in 3.x and 2.3 — hosting cron on a URL with a secret key shown by the module.
Version history
An archive of old orders readable by the customer account, the order page, the invoice, reports and modules; automatic restore on any change, including from Multi PRRO and Returns &…
Frequently bought with Order Archive for OpenCart
4 modules in one order — 40% cheaper than separately


Nova Poshta Premium — a Nova Poshta module for OpenCart 2.3, 3.x and 4.x

LiqPay — Card Payments for OpenCart 2.3, 3.x and 4.x

Telegram notifications and Viber/SMS for customers for OpenCart
Full module description
Order Archive for OpenCart is a module for stores that have collected tens of thousands of orders over the years. Standard OpenCart keeps all orders in the same tables: every list, search, filter and counter in the admin header goes through both fresh orders and those completed three years ago. Deleting old orders is not an option: customers open them in their account, accounting needs reports, and returns and CRM need the history.
The module moves old completed orders to separate archive tables and makes sure OpenCart “does not notice”: the customer still sees all his orders in the account, the order page and invoice open in the admin, and reports still count archived orders. Any change to an archived order — a new status, a payment callback, a status from a CRM — first brings it back to the store. The module does not touch the OpenCart core, templates or OCMOD patches.
Running WooCommerce? There is a separate Order Archive for WooCommerce plugin with the same approach: old orders go into a compressed archive, reports and customer totals stay the same, search and one-click restore.
What the customer sees
Nothing changes for the customer. He opens “Order History” and sees all his orders — new ones and three-year-old ones — in one list, in the same order and with the same pages. He opens an old order and sees the products, totals, addresses and status history. “Reorder” puts the product into the cart, “Return” opens the return form filled with the order data.
The archive does not affect new orders: the standard checkout and One Page Checkout work as usual, and new order numbers continue after the archived ones.
What the admin gets
An “Order archive” item in the “Sales” menu with three tabs.
Overview
How many orders are in the store and in the archive, table sizes, the oldest order in the store. The rules are written in plain words (“Orders placed more than 24 months ago, in the statuses Complete, Canceled, not changed for 90 days”). “How many would go now?” counts the candidates, “Archive now” moves them step by step with progress — the run can be stopped at any time. Below are “Optimize tables” (gives the freed space back to the disk after the first big run) and the log: what was archived or restored, when and by whom.
Archive
Search by order ID, customer, e-mail, phone, date and status. An archived order can be viewed and printed without restoring it. “Restore” brings one order back to the store, “Restore selected” and “Restore all found” — a group. In Pro the found orders can be exported to CSV right here.
The standard order list
The Sales > Orders list stays as it was and shows only the orders in the store — that is why it is fast. When you filter the list (by customer, order ID, e-mail, status), a line appears under it: “The archive has N more orders that match this filter.” with a link to them.
Settings
- Rules: order age in months (24 by default), the statuses that may be archived (by default — the store’s “complete” statuses), how many days the order has not changed (90), the batch size.
- Safeguards: keep orders with downloads in the store; do not archive orders with a return changed within the last N days (180); how many days a restored order stays in the store (90).
- Compatibility: customer account, admin order page, reports, the line under the order list, “restore when opened”, dashboard counters — each layer is switched on separately.
- Pro: schedule, unfinished checkouts, final deletion.
How it works — step by step
- Install. The module creates archive tables with the same structure as the order tables of your store (
order,order_product,order_option,order_total,order_history,order_voucher; plusorder_custom_fieldin 2.3). Columns added by other modules are picked up by the archive before every run. - Choosing candidates. Orders older than N months, in the selected statuses and not changed for N days. Never archived: the newest order, orders with a subscription or recurring payment, with a sold gift voucher, with downloads (a setting), with a recent return, recently restored from the archive, and those a CatCode module is still working on: a queued Nova Poshta waybill, an unsent KeyCRM / SalesDrive / KeepinCRM sync, an unfinished PRRO receipt, an open Returns & Exchanges request, an unchecked payment in Payment Status Sync.
- Moving. In steps of 200 orders (configurable). Every step is one transaction: the rows are copied to the archive, the counts are compared for every table, and only then the rows are deleted from the store. If they do not match, the whole step is rolled back.
- Reading. When OpenCart looks up one order through its models (account, order page, invoice, modules that read orders the standard way) and does not find it in the store, the module repeats the same query in the archive. The account list merges both sources with correct paging, reports read the store and the archive together.
- Changing. Any attempt to change an archived order through OpenCart (a new status, editing, an invoice number, deletion), as well as a Multi PRRO refund receipt and actions on a Returns & Exchanges request, first brings it back to the store. A restored order stays in the store for 90 days.
- Restoring by hand. From the “Archive” tab — one, selected or all found; the rows come back exactly as they were.
Under the hood
- No core edits and no OCMOD. OpenCart events only: order models in the account, checkout and admin, reports, the order list, the order page.
- The archive is a copy of the structure, not a new format. The
cc_oarch_*tables are created withCREATE TABLE … LIKE, so a row in the archive is the same order row, and a restore is an exact copy back. - Transactions and locks. Every archiving or restore step is one InnoDB transaction and one named database lock, so scheduled archiving and a manual restore never overlap.
- Reports. While a report model runs, the order tables are replaced with “store + archive”; on the dashboard — only with a separate switch, so the admin home page stays fast.
- What stays in place: customer transactions and reward points, coupon history (coupon limits still count old orders), returns, gift vouchers, subscriptions, tables of other modules.
- Honest about the limits. Modules by other developers that read the order table with their own SQL do not see archived orders — that is why only long-completed orders go to the archive, and the admin order page by default brings an archived order back to the store. A status changed in KeyCRM for an order that is already in the archive is not applied until the order is restored. The storefront “Bestsellers” block counts only the orders in the store. Reports that also read the archive run slower than before archiving (measurements are in the FAQ).
How to install
- Download the archive for your version:
cc_orderarchive.ocmod.zip(OpenCart 4.x),cc_orderarchive-oc3.ocmod.zip(3.x) orcc_orderarchive-oc2.ocmod.zip(2.3). - OpenCart 4 and 3: Extensions > Installer > “Upload”. OpenCart 2.3: copy the contents of the
upload/folder from the archive to the store root. - Extensions > Extensions > Modules > CatCode Order Archive > “Install”.
- Open Sales > “Order archive” > “Settings”, check the rules and statuses, save.
- On the “Overview” tab press “How many would go now?”, then “Archive now”. Run the first big archiving at a quiet hour, and “Optimize tables” after it.
Questions
about the module
Didn't find the answer? Message us on Telegram and we'll reply within a business day.
Will customers still see their old orders?
Yes. "Order History" in the account shows live and archived orders together, in the same order and with the same pages as before archiving. The archived order page, the "Return" and "Reorder" buttons work. We compared the account pages before and after archiving on 4.1, 4.0.2, 3.0 and 2.3 — they are identical.
What happens if an archived order changes?
The module first brings it back to the store tables, and only then OpenCart makes the change. This works for a new status from the admin, a payment callback, a status from a CRM, a refund receipt in Multi PRRO and a refund in Returns & Exchanges. The history is not lost: the old rows and the new one are together in the live order. A restored order stays in the store for 90 days (configurable), so the next run does not take it back right away.
Can I undo everything?
Yes, at any time: one order, selected orders or all found by a filter. Restoring moves the rows back exactly as they were — we compared checksums of all order tables before archiving and after a full restore.
Will the reports "drop"?
The Sales and Products Purchased reports read the store and the archive together — the numbers are the same as before archiving. The price is the speed of the report itself: it reads both the store and the archive every time, so on 60,000 orders the Sales report took 1.7 s instead of 0.3 s and Products Purchased 2.8 s instead of 0.25 s. If you do not need archived periods in reports, switch off "Reports count archived orders". The counters on the admin dashboard count only orders in the store by default (so the dashboard stays fast); if you need the full numbers, switch on "Dashboard counts archived orders".
What if a module by another developer reads the order table directly?
Such a module sees only the orders in the store. That is why only old completed orders are archived (by default — older than 24 months, not changed for 90 days), and the admin order page by default brings an archived order back to the store as soon as you open it. We tested CatCode modules together with the archive.
What about product returns?
Standard OpenCart returns stay where they are. An order whose return changed within the last 180 days is not archived. Open requests in CatCode Returns & Exchanges keep the order in the store too.
What happens if I uninstall the module?
The archive tables stay — your orders are in them. But without the module OpenCart does not see them. So before uninstalling, press "Restore all found" on the "Archive" tab. Installing the module again finds the archive again.
How long does the first archiving take?
It depends on the server. On a local test store (MariaDB 10.11, PHP 8.3): 60,001 generated orders: 29,150 matched the rules and went to the archive in 6.9 s, a full restore took 4.4 s, a scheduled run 6.5 s. On shared hosting it will be slower, but every step is limited in time, so the request does not die on a timeout, and the progress shows how many orders have already moved. Every step is one transaction, so an interrupted run breaks nothing: just press the button again.
Can I delete old orders for good?
Yes, in Pro, and only those already in the archive and older than the age you set (from 12 months, 84 by default). This cannot be undone, so export them to CSV first. Off by default.
How does the module behave with One Page Checkout and new orders?
The archive does not touch new orders: they are placed as usual, and new order numbers continue after the archived ones. The newest order is never archived, so the order number counter in MySQL never goes back.
No reviews yet. Be the first.
No questions yet. Ask one — we answer within 24 hours.
Not quite what you are looking for?
We build custom modules for WordPress, WooCommerce, OpenCart and Shopify. Tell us about the task and we'll prepare an estimate.
Order a custom module
Buying the module
—
