For OpenCart 2.3, 3.0, 4.0 and 4.1
The rules
WHAT YOU SEE (Extensions > Modules > Supreme Advanced Shipping Rules)
- Up to 200 rules. Every rule has a name (shown at checkout), a short note ("2-4 days"), a sort number, and an on/off switch.
- A rule looks at the cart weight, the cart sub-total or the number of items. It fits when the value is from "From" up to and including "Up to" (0 = no upper limit). Two rules that meet at the same number both fit: both are offered.
- The price: a fixed price plus a handling fee, plus an optional extra for every started step (for example from 1 kg: 50, and 20 more for every started kilo).
- Free shipping: "free when the sub-total reaches ...". The sub-total of the whole cart decides, whatever the rule looks at.
- Geo zone: the rule fits only when the delivery address is in the geo zone you choose.
- Postcodes: a list separated by commas. Each item is a postcode (560001), a range of numbers (110001-110099) or the start of a postcode with a star (SW1*, 400*). Spaces and capital letters do not matter. Empty = every address.
- Product categories: the rule fits when the cart has a product from the chosen categories, when every product is from them, or when no product is from them.
- Customer groups: choose the groups the rule is for; none chosen = everyone.
- "Stop after this rule": when that rule fits, the rules below it are not offered.
- The tax class of the shipping price and the name above the choices are settings.
- The settings and the rule editor in one page: a list of the rules and a form to add, change or delete a rule. A rule is checked when you save it: a missing name, a number that is not 0 to 9,999,999, an upper limit below the lower limit, a postcode list that is not valid (or more than 40 items), categories chosen but none selected, and a geo zone that does not exist are refused and the message says what to fix.
Safe by design
- Names are cleaned to plain text when saved and escaped again at checkout. The admin page needs Access, saving and deleting need Modify and answer POST only; the rules cannot be read without an admin session. Every number is checked and the product and category numbers are whole numbers only.
Notes
- The rules are your data: they are kept when you uninstall and are there again after a reinstall.
- The prices in the rules are in the shop currency and without tax; choose the tax class in the settings if shipping is taxed in your shop.
- This module adds its own shipping method; it does not hide the shipping methods of other extensions.
- The admin screens are in English only. The module has no storefront text of its own: the names at checkout are the ones you type.
- Tested on OpenCart 4.1.0.4, 4.0.2.3, 3.0.5.1 and 2.3.0.2 with the real admin installer (install, settings, rule checks, prices for real carts, the core shipping list, a real order that keeps the chosen rule, switching off, uninstall, reinstall). The rule editor on the admin page was syntax-checked but not clicked in a browser, and the price with a real tax rate was not tested.