For OpenCart 2.3, 3.0, 4.0 and 4.1
Plans you define
- A name, a repeat interval (every N days, weeks or months) and a percentage discount.
- Each plan applies to every product, to the product IDs you list, or to the products in the category IDs you list. A product page offers every plan that applies to it.
What the customer sees
- A "Subscribe and save" box inside the add-to-cart area of the product page (signed-in customers; guests see a log-in note). "One-time purchase" stays the default.
- The plan discount as its own "Subscription discount" line in the cart and checkout totals.
- A "My subscriptions" page, linked from the account page, to pause, resume, skip the next renewal or cancel, protected by a form token. Each customer sees and changes only their own.
How renewals work
- A subscription starts when the first order reaches a processing or complete status, with a snapshot of the plan (interval and discount at that time). Further status changes never start a second one, and guest orders never subscribe.
- When a renewal is due, a new order is created from the first one: same customer, addresses, payment and shipping method, same product options, the product at the price it was bought at, minus the plan discount, shipping lines repeated. The order then goes through your normal order flow (status, stock, order history). You choose the status of a new renewal order and whether the customer gets your shop's usual order e-mail.
- Due renewals are created by a private cron address (hourly is plenty), or automatically when shop pages are visited (at most every 10 minutes). The next date is moved before the order is made, so a crash never creates two orders, and a long outage renews once instead of once per missed interval.
- A product that is disabled or gone fails the subscription with the reason shown; the admin can resume it.
For the store owner
- A subscriptions list with customer, product, plan, next renewal and status, filters by status and customer, and buttons to pause, resume, cancel or "Renew now".
- A renewal log with the order created or the reason it failed.
- Settings: on/off, automatic renewals on/off, renewal order status, customer e-mail on/off, the cron address with a button to make a new secret key.
- Every storefront text is in one language file you can copy and translate. No core files are edited.
Notes
- No card is charged by this module. Renewal orders copy the first order's payment method, so they suit offline methods (cash on delivery, bank transfer, cheque, pay on invoice). With an online gateway the renewal order is created with your chosen status and the customer must pay it as usual.
- The discount is taken off the order total as its own line; it does not change tax amounts. Tax and shipping of a renewal are taken from the first order.
- One subscription per cart line. Plans, subscriptions and the renewal log are kept if you uninstall the module; settings, event hooks and the discount line are removed.