Configuring Order Approval Rules¶
Extension settings¶
The extension's settings page under Extensions contains the Enabled switch and an information box. There are no settings to fill in. Everything is configured through rules.
Rules¶
Rules are managed under Order Approval Rules in the Extensions navigation group. The list shows Rule name, Type, Condition, Priority and Enabled for each rule, sorted by priority. You can search by rule name. Use New approval rule to add a rule and Edit or Delete on a row to change or remove one.
Rule form¶
| Field | Type | Default | What it does |
|---|---|---|---|
| Rule name | Text, required, up to 255 characters | empty | The name is stored with every review the rule triggers and shown in the Triggered rule(s) column of the review list. |
| Rule type | Select, required | Order value | Decides what the rule checks. See Rule types. The fields below it change with the type. |
| Operator | Select, required | is greater than | Only for Order value. Either is greater than or is greater than or equal to. |
| Amount / Minimum account age (hours) / Service count | Number, required, 0 or higher | empty | The threshold. The label depends on the rule type. Not shown for Product specific. |
| Product | Searchable select, required | empty | Only for Product specific. The product that sends an order into review. |
| Priority | Whole number | 0 |
Sort order. Rules with lower numbers are listed first, both in the rule list and in the Triggered rule(s) column. It does not change which rules are evaluated. Use 0 or a positive number. |
| Enabled | Toggle | On | A disabled rule is skipped when new orders are checked. |
Rule types¶
| Rule type | Matches when | Threshold field |
|---|---|---|
| Order value | the order total is greater than (or, with the second operator, at least) the amount | Amount |
| New account | the customer's account was created less than the given number of hours ago | Minimum account age (hours) |
| Active service count | the customer has at least the given number of services that are not cancelled | Service count |
| Product specific | the order contains the selected product | Product |
Details that matter when you pick thresholds:
Order value
- The order total is Paymenter's own order total: service price times quantity, added up over all services of the order. It is not read from the invoice.
- The amount is compared as a plain number against the total in the order's currency. There is no currency conversion and no currency field on the rule.
- The comparison uses the exact amount you entered. The Condition column of the rule list shows the amount without its decimal part, so a rule with the amount
99.50is listed as "Order total is more than 99.00" but still compares against 99.50.
New account
- The age is measured from the account's creation time to the moment the order is checked.
- Hours are whole numbers. A decimal part is cut off.
- With
0hours the rule never matches.
Active service count
- All services of the customer are counted except those with the status
cancelled. Pending and suspended services count. - The services of the order being checked already exist at that moment and are counted too. A customer with two existing services who orders one more has a count of three.
- Each service counts once, whatever its quantity.
- The count is a whole number. A decimal part is cut off. With
0the rule matches every order, and with1it matches every order that contains a service.
Product specific
- The rule matches when any service of the order belongs to the selected product.
- If the product is deleted later, the rule loses its product and no longer matches. The rule list then shows "Order contains a product (none selected)".
How rules are evaluated¶
- Rules are checked once per order, right after the order has been created. Editing, enabling or adding a rule does not re-check existing orders.
- Every enabled rule is checked. There is no "first match wins": all matching rules are stored with the review, in priority order (ties are ordered by creation).
- One matching rule is enough to create a review. An order has at most one review.
- The review stores the rule names as they were at that moment. Renaming, disabling or deleting a rule afterwards does not change or release existing reviews.
Database tables¶
| Table | Content |
|---|---|
ext_order_approval_rules |
Rules: name, type, operator, value, product, priority, enabled |
ext_order_reviews |
Reviews: order, status (pending, approved, rejected), triggered rule names, reviewing administrator and time |
Deleting an order in Paymenter deletes its review.