For OpenCart 2.3, 3.0, 4.0 and 4.1
How the levels work
WHAT THE CUSTOMER SEES (account page)
WHAT YOU SEE (Extensions > Modules > Supreme VIP Tiers)
- You list up to 8 levels: a name, the amount a customer must have spent, the customer group they move into and a short perk text ("10% off and free delivery").
- Spending is the sum of the customer's orders in a finished status (Complete by default), in the shop currency. Orders paid in another currency are converted back. You can also count orders that are still processing.
- When an order changes status, its buyer is checked at once. A big order can jump straight over a level. A refund or a cancelled order lowers the spending, and the customer moves back down (switch "Move customers down" off to keep a level once it is reached).
- Spending can count for all time or only for the last N days (0 to 3650), so a customer who stops buying can slide down. Old orders that leave the window are noticed when the customer opens the account page, and by the "Check all customers now" button.
- Only customers in the shop's default group and in the level groups are looked after. Customers in any other group (wholesale and so on) are never moved and see no level box.
- A box under the page title: the current level, the total spent, a progress bar, the line "Spend $390.00 more to reach Gold." (or "You are on the top level."), and the list of levels with their amounts and perks. The levels reached are marked.
- The starting level has a name you choose (Member by default). The accent colour is a setting.
- All wording is in one language file: copy it into another language folder and translate the right-hand side.
- Customers per level, and the number of moves in the last 30 days and in all.
- A level editor (name, amount, customer group, perk), checked when you save: a missing name, an amount of 0 or that is no number, a group that does not exist, the shop's default group, two levels with the same amount or group, or more than 8 levels are refused and the message names the level.
- A button to check every customer of the looked-after groups (100 at a time), for use after you change the levels or the window.
- A list of the latest moves: date, customer, from group, to group, the spending and the reason (order, visit or check). The list is kept when you uninstall; the check button clears entries older than a year.
Safe by design
- Levels and the checks are decided on the server from the orders in the database; nothing the browser sends can raise a level.
- Level names and perks are cleaned to plain text and escaped on every page. Admin pages need Access, changes and the check button need Modify, and the check button only answers POST.
Notes
- The default group is read from store 0 of the settings.
- There is no e-mail when a customer reaches a level and no scheduled job: the level is refreshed when an order changes, when the customer opens the account page and when you press the check button.
- A change of order lines made in the admin (for example with Supreme Order Editor) does not move the customer until the next order change, account visit or check.
- The admin screens are in English only; the storefront text is translatable.
- 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, real orders through the order model, uninstall, reinstall). The level editor and the check button on the admin page were syntax-checked but not clicked in a browser.