Skip to content

Requirements and install

Pre-Order installs like every other extension sold here. Follow the shared procedure rather than a Pre-Order-specific one:

What is specific to Pre-Order

The permission entry to tick at step 3 of the shared procedure is:

extension/preorder/module/preorder

Tick it under both Access Permission and Modify Permission, for every user group that should be allowed to use Pre-Order. Modify is what lets somebody send a payment request, reissue a link, release a line or cancel one; access alone is a read of the screen.

Installing also gives your own user group two more entries, for the two data-protection screens. For any other group that needs them, tick them the same way:

  • extension/preorder/customer/personal_data, access only, for Customers → Personal Data. What that screen does is guarded by OpenCart's own Modify on customer/customer.
  • extension/preorder/customer/purge, access and modify, for the screen that removes everything Pre-Order holds about people. It is separate so you can hand somebody the first without the second.

It installs a payment method as well, and needs it

Enabling the module also installs Pre-Order under Extensions → Extensions → Payments and switches it on. That is the placeholder a deferred pre-order is taken with. It charges nothing and writes the Pre-Order Received status. Leave it alone.

If it is missing or switched off while you are holding deferred pre-orders, a shopper placing one is offered your real payment methods and charged today. The module's own screen says so in red when that is the state of the store.

It writes three order statuses

Pre-Order Received, Pre-Order Payment Requested and Pre-Order Expired, into System → Localisation → Order Statuses, in every language the store has. They are named in English, because the extension ships English only.

You may rename them or delete them. The pre-orders themselves are unaffected, and a deleted one is written back the next time the module is enabled.

One daily sweep, and three ways to run it

The reminder halfway through a payment window, and moving an unpaid order to Pre-Order Expired at the end of it, are one daily sweep. There is one pass behind all three doors below. Pick the one your host gives you and use only that one.

1. OpenCart's own scheduler. There is nothing to do: enabling the module registers a daily job under Extensions → Cron Jobs. It needs a crontab on the host calling OpenCart's cron.php, which most hosts either offer or already run. On OpenCart 4.1.0.4 this door does not work at all. That release broke OpenCart's scheduler inside core, for every extension on the store, so use one of the other two. See limits.

2. A web address, for a host that gives you a cron panel or where you use a third-party cron service, and no shell. Pre-Order's settings screen shows the address under Sweep address; copy it and have it fetched once a day. The secret in it is the only thing that admits the caller, so treat it as a password. If you ever paste it somewhere you would rather you had not, press New address on that screen and paste the new one in its place. Anything using the old address stops working the moment you do, which is why that button asks you to confirm.

3. A command, for a host that gives you a shell. From your store's directory:

php extension/preorder/preorder.php

It exits 0 when the sweep ran and 1 when it did not, so a cron line, a deploy script or a monitoring check can act on the result. A crontab line running it daily at four in the morning:

0 4 * * * cd /path/to/store && php extension/preorder/preorder.php

A store where none of the three runs loses those two things and nothing else. A payment link is dead at the end of its window whether or not anything ran, and Asked to pay, not paid on the Pre-Orders screen is the list that surfaces the orders nothing tidied up.

What it stores

Four tables of its own, all prefixed preorder_: what you marked as a pre-order, one row per pre-order line of an order, one payment link per order, and a copy of your settings so an update cannot lose them.

What an update keeps, and what it asks for again

An update in OpenCart is an uninstall followed by an install, which deletes an extension's settings before it gets any say. Pre-Order keeps its own copy of them and puts it back, so days to pay, the payment mode a new product row starts at and your wording all survive an update.

Two things do not:

  • Whether the module is enabled. OpenCart clears it, and an extension that switched itself back on would be deciding your storefront should start selling something. Re-enable it after an update. Until you do, an outstanding payment link tells the customer it is no longer valid.
  • The permission entries, if you removed them. Enabling the module grants them to the user group doing the enabling, and to nobody else.

Your pre-orders, the three order statuses and every outstanding payment link are untouched by an update. See what an uninstall keeps for the two ways of removing it, which behave differently.