Get in touch
Payments · OpenCart

Cash-on-Delivery Fee / Prepayment Discount for OpenCart 2.3, 3.x and 4.x

Обраний метод оплати додає в підсумок кошика й чекауту окремий рядок — надбавку за післяплату або знижку за передоплату чи самовивіз. Безкоштовна версія дає одне правило: фікс або відсоток, мін/макс, поріг суми кошика, власний лейбл, податковий клас і коректний перерахунок при зміні методу оплати. Pro знімає ліміт на кількість правил і додає умови за методом доставки, категорією товару, групою покупців і розкладом дії.

Download for free
Version
v1.1.1 (OpenCart 4)
v1.1.0 (OpenCart 3.x)
v1.0.1 (OpenCart 2.3)
Compatibility
OpenCart 2.3.0.0 – 2.3.0.2 · 3.0.2 – 3.0.5.0 · 4.0.2 – 4.1.x
Platform
OpenCart
Cash-on-Delivery Fee / Prepayment Discount for OpenCart 2.3, 3.x and 4.x

What each licence includes

Feature Free Pro
“Payment method → surcharge or discount” rule 1 rule no limits
Fixed amount or percentage
Minimum and maximum fee amount (percentage clamp)
Cart total threshold “from / to”
A separate line in the cart, checkout and order with a custom label
Recalculation on payment method change without a page reload
Tax class / VAT for the fee line
Calculation base — the cart's product total
Unlimited rules with execution priority
“Shipping method” condition — including a separate pickup discount
“Product category in cart” condition
“Customer group” condition
Rule validity schedule — valid from / to

Cash on delivery costs a store money: the carrier’s fee, return shipping for refused parcels, tied-up cash and a percentage of unclaimed orders. COD Fee / Prepayment Discount lets you shift that difference into the checkout: the chosen payment method adds a separate line to the order total — a surcharge or a discount. The customer sees it before confirming the order, and the amount recalculates every time they switch payment method.

The basic version is free and has no time limit: one rule — “payment method → surcharge or discount”, a fixed amount or a percentage, min/max, a cart total threshold and a custom line label. A fresh install is a clean free version: nothing Pro switches itself on. Pro can be trialled free for 7 days — the trial only starts once you click “Try Pro” in the settings. Separate builds exist for OpenCart 4.x, OpenCart 3.x and OpenCart 2.3 — links are in the “How to install” section.

What the customer sees

OpenCart checkout with a ‘Cash on delivery fee’ line in the order total
OpenCart checkout: product 629.99, shipping 5.00, a separate “Cash on delivery fee” line of 30.00 — total 664.99. The line appears only when “Cash on delivery” is selected; switch to an online payment method and the total recalculates instantly, with no page reload.

What the admin gets

COD Fee extension settings in the OpenCart 4 admin — free version
Fresh install — the free version: a “Free version” badge, the basic “payment method → surcharge or discount” rule, a tax class, a cart total threshold and a sort order among the other totals.
Rules tab without a licence: fields greyed out, with a Pro badge
The Pro boundary is shown exactly where it applies: the extra rules are visible but greyed out, with a Pro badge and one line explaining what the licence adds. Nothing is hidden behind a banner.
CatCode Pro window: ‘Try for 7 days’ and ‘I have a key’ tabs
The trial only starts on a click: enter your email and you get a genuine 7-day key straight away (it also arrives by email). Next to it is a tab for a key you’ve already bought.
Pro rules: priority, mode, amount type, conditions by shipping, category, customer group and dates
With Pro you can have as many rules as you like: priority, mode (surcharge or discount), fixed amount or percentage, min/max, cart threshold, payment and shipping method, product category, customer group and a validity period.
An activated Pro licence with an expiry date
An activated licence: Pro status, a “valid until” date and an “Unlink this site” button, so you can move the key to another domain yourself.

How it works, step by step

  1. You create a rule: choose a payment method (for example “Cash on delivery”), a mode — surcharge or discount — and an amount type — fixed or a percentage of the base.
  2. Set the limits. For a percentage, you set a min and a max: 5% of 899 UAH gives 30 UAH if the minimum is 30; 5% of a large order hits the maximum. 0 means no limit.
  3. Restrict the cart range — “from / to”. The fee won’t apply to orders cheaper or more expensive than the given amounts.
  4. Choose a tax class for the line, if the fee needs to be subject to VAT. The line’s sort order must be lower than the sort order of the “Tax” total (5 by default) — the recommended value is 4.
  5. At checkout, the customer selects a payment method — the line appears or disappears, the total recalculates, and the same value is written into the order.
  6. With Pro you can have as many rules as you like: they’re checked by priority (a lower number means higher priority), and the conditions also include shipping method, product category in the cart, customer group and a date range.

Pricing

1,290 UAH — a one-off purchase. The licence is perpetual: you pay once, and updates and technical support are included in the price. One key covers one domain and its subdomains.

Moving the store to another domain? Deactivate the licence on the old one and activate it on the new one yourself, from your account.

The licence is perpetual — nothing expires or switches off. One key covers one domain; if you move the store, deactivate the licence on the old domain and activate it on the new one yourself.

Trial first, payment later. The trial only starts on your click: click “Try Pro” in the extension settings, enter your email, and you get a genuine 7-day key straight away (it also arrives by email). During that time you can build the full rule matrix (a COD surcharge, a prepayment discount, a separate pickup discount) and see how it behaves on real orders. That’s exactly why refunds aren’t offered after payment.

Technical requirements

  • OpenCart 4.0.2–4.1.x — build cc_codfee.ocmod.zip v1.1.0
  • OpenCart 3.0.2–3.0.5.0 — a separate build, cc_codfee-oc3.ocmod.zip v1.0.0
  • OpenCart 2.3.0.0–2.3.0.2 — a separate build, cc_codfee-oc2.ocmod.zip v1.0.0
  • PHP 7.4+ for the OC3 and OC4 builds (tested on 8.1–8.3); the 2.3 build already runs on PHP 5.6 and 7.0
  • No external services: the calculation happens entirely on your server

Under the hood

  • The standard totals mechanism. This is a full-fledged total-type extension — the line sits alongside “Sub-Total”, “Shipping” and “Tax”, so it lands in the order, emails and reports without any separate workarounds.
  • Different signatures in OC3 and OC4. In OpenCart 3.0.5 the total method takes getTotal($total) with a totals / taxes / total array, while OpenCart 4 uses three separate references. The port handles both, so the same calculator gives the same result on both branches.
  • Normalising the payment method code. OpenCart 3 stores cod in the session, OpenCart 4 stores cod.cod. The module reduces both formats to the base code, so a rule set up once works on any version.
  • No tax surprises. The line can be assigned a tax class, and VAT is calculated from the fee itself — provided the sort order relative to the “Tax” total is correct.

How to install

  1. OpenCart 4.x: download cc_codfee.ocmod.zip, install it via “Extensions → Installer”, then “Extensions → Order Totals” → “COD Fee” → “Install” → “Edit”.
  2. OpenCart 3.0.x: download cc_codfee-oc3.ocmod.zip, install it via “Extensions → Installer”, refresh the cache in “Extensions → Modifications”, then go to “Extensions → Order Totals”.
  3. OpenCart 2.3.x: download cc_codfee-oc2.ocmod.zip, unpack it and upload the contents of the upload/ folder to the store root via FTP or your hosting file manager. The standard 2.3 Installer only copies files over FTP and doesn’t work on most hosting, so installation is manual. Then go to “Extensions → Order Totals” → “Install” → “Edit”. The core isn’t patched: install.xml in the archive only registers the extension in the modifications list.
  4. Enable the status, enter the line name (for example “COD Fee”), choose a payment method and set an amount or percentage.
  5. Check that the payment method you need is actually installed under “Extensions → Payment” — otherwise it won’t appear in the list.
  6. If the fee should be subject to VAT, choose a tax class and set the sort order to 4 (lower than the sort order of the “Tax” line).
  7. For Pro: click “Try Pro” — in the window, either take the 7-day trial by email or paste a purchased key on the “I have a key” tab. Once activated, all rules apply, not just the basic one.

Version history

1.1.0 (OpenCart 3.x) — 11 August 2026
The OpenCart 3.0.x build has moved to a server-side licence. Previously Pro would unlock with any key matching the right format, and the trial period switched itself on at the first save — now a fresh install is a clean free version, the 7-day trial only starts on a click, and saving settings no longer wipes an activated key. Fixed a line-name truncation bug: a label with a quote or ampersand (“Nova” Fee & Co) closed the field attribute at the first character and broke on the next save.
1.1.1 (OpenCart 4.x) and 1.0.1 (OpenCart 2.3) — 11 August 2026
A rule restricted by customer group didn’t fire on a guest order: OpenCart returns an empty group for a guest, so the condition never matched — exactly where the COD fee is needed most. Now the guest session’s group is used, falling back to the store’s default group if there isn’t one.
1.0.0 (OpenCart 2.3) — 9 August 2026
A separate build for OpenCart 2.3.0.0–2.3.0.2, PHP 5.6 and 7.0. A direct port from the 4.x branch: the template was rewritten from Twig to plain PHP for Bootstrap 3, settings are saved as a single option (the settings group in 2.3 is the extension code), and the total’s signature here is getTotal($total) with an array carrying the internal references. The core isn’t modified — order totals in 2.3 are a standard extension point. The server-side licence and the 7-day click-to-start trial work the same as in the newer branches.
1.1.0 — 4 August 2026
OpenCart 4.x. The Free/Pro model was rebuilt: a fresh install no longer enables Pro on its own, and the trial only starts when you click “Try Pro”, issuing a genuine 7-day key. The key is checked against the CatCode server (activation, a daily check, a 14-day grace period if the server is unreachable), not just by its format. The Pro boundary is now visible where it applies: extra rules are shown greyed out with a Pro badge and a benefit line. The unobtrusive Pro notice closes for good.
1.0.0 — 28 July 2026
First release of both builds. OpenCart 4.x: a total-type extension with “General / Rules (Pro) / Licence” tabs, rule priorities, a tax class. OpenCart 3.x: a separate port with its own install.xml — accounting for the different total signature in OC 3.0.5 and the payment method code format without a dot.

Frequently asked questions

Why isn't the fee line visible in the cart?

The payment method is chosen at checkout, so it isn't known yet in the cart. The line appears in the total once the customer has selected a payment method.

Can I charge a percentage but not less than a fixed amount?

Yes. Choose the “percentage” type and set the lower bound in the “min” field. “Max” works the same way: 5% of a large order won't exceed the ceiling you set. 0 in both fields means no limits.

How do I set up a prepayment or pickup discount?

Create a rule with “Discount” mode and select the online payment methods in it. A pickup discount is a Pro rule with a shipping-method condition.

Is the fee subject to VAT?

If needed, yes — assign the line a tax class. One nuance to note: the fee line's sort order must be lower than the sort order of the “Tax” total (5 by default), otherwise tax won't be calculated on the fee. The recommended value is 4.

Why isn't the payment method I need in the list?

The module only shows methods that are actually installed under “Extensions → Payment”. Install the method you need and it will appear in the selection.

Is it one build for OpenCart 3 and 4?

No, it's two separate ports in one package: cc_codfee.ocmod.zip for 4.0.2–4.1.x and cc_codfee-oc3.ocmod.zip for 3.0.2–3.0.5.0. The settings and calculation logic are identical.

Does the licence need renewing?

No. For OpenCart the licence is perpetual, so all rules keep applying. Only the 7-day trial ends: after it the extra rules stay saved, and only the first (basic) free-version rule applies.

Questions about the module?

Message us on Telegram — we reply within the working day. We will help with setup, compatibility and key activation.

@catcode_support

Not quite what you are looking for?

We build custom modules for WordPress, WooCommerce, OpenCart and Shopify. Tell us about your task and we will prepare an estimate.

Order a custom module