Products and Entitlement Classes
Every WooCommerce product in the MIDDAG ecosystem maps to an Entitlement Class. This mapping tells MIDDAG Account what type of access to grant when a customer purchases the product. One product maps to exactly one class.
The six Entitlement Classes
| Class | Name | What it represents | What gets created on purchase |
|---|---|---|---|
| PLG | Plugin | Software license | Entitlement + License key + Download access |
| ENV | Environment | Managed hosting instance | Entitlement + Environment instance |
| SVC | Service | Ongoing service or project | Entitlement + Service + Contract + Credit Balance |
| ORD | Order | General-purpose purchase | Entitlement (generic, linked to order) |
| AFL | Affiliate | Partner program membership | Entitlement + Affiliate tracking |
| EDU | Education | Training, mentoring, course | Entitlement + Course access |
How mapping works
When you create or edit a WooCommerce product, a MIDDAG Account panel appears in the product editor. This panel contains:
- Entitlement Class -- Select one of the six classes above.
- Class-specific settings -- Fields that vary by class (license duration, environment tier, service category, etc.).
- Policy overrides -- Optional per-product overrides for renewal, refund, cancellation, and other policies.
Products without an entitlement class mapping are treated as standard WooCommerce products. No entitlement is created when they are purchased.
Product meta fields
The mapping is stored as WooCommerce product meta:
| Meta key | Type | Description |
|---|---|---|
_middag_entitlement_class | string | The class code: PLG, ENV, SVC, ORD, AFL, EDU |
_middag_provisioning_mode | string | auto (default) or manual |
_middag_policy_overrides | JSON | Per-product policy overrides (optional) |
Additional meta fields depend on the class. For example, PLG products have _middag_license_duration and _middag_activation_limit.
Product Registry [Planned]
The Product Registry is a planned admin screen (MIDDAG Account > Settings > Product Registry) that provides a centralized view of all WooCommerce products and their entitlement class mappings. From this screen you can:
- See all products with their current class assignment
- Bulk-assign or change classes
- View products that have no mapping (and therefore will not create entitlements)
- Filter by class, category, or status
Until the Product Registry is implemented, mappings are configured in the individual product editor.
Examples
Plugin product (PLG class)
A product like "MIDDAG for Moodle -- FULL" (SKU: PLG-MOODLE-FULL):
- Entitlement Class: PLG
- Billing type: Subscription (monthly or annual)
- On purchase: Creates an entitlement with code like
PLG-2026050042, generates a license key, enables download access - On renewal: Extends the entitlement expiration date, license key remains the same
Hosting plan (ENV class)
A product like "Managed Hosting -- Standard" (SKU: SVC-HOST-BASIC):
- Entitlement Class: ENV
- Billing type: Subscription (monthly)
- On purchase: Creates an entitlement with code like
ENV-2026050003, provisions an environment instance - On renewal: Extends the entitlement, environment stays active
Support plan (SVC class)
A product like "Monthly Support -- Business" (SKU: SVC-SUP-BUSINESS):
- Entitlement Class: SVC
- Billing type: Subscription (monthly or annual)
- On purchase: Creates an entitlement, service record, contract, and initial credit balance
- On renewal: Extends the entitlement, refreshes credit balance according to the plan
Training session (EDU class)
A product like "Training Session 1h" (SKU: EDU-BRIDGE-SESSION):
- Entitlement Class: EDU
- Billing type: One-time
- On purchase: Creates an entitlement with access to the training session
Product-level policy overrides
Each product can override global and class-level policy values. The override hierarchy is:
Global defaults
-> Class defaults (e.g., all PLG products)
-> Organization overrides
-> Product overrides <-- configured here
-> Individual entitlement overridesMost specific wins. If a product does not define an override, the value is inherited from the level above.
Common product-level overrides:
| Policy | Override example |
|---|---|
| Refund | Shorter refund window for one-time products (7 days instead of 30) |
| Renewal | Renewal at current catalog price instead of original purchase price |
| Trial | Enable trial for specific ENV products (14 days) |
| SLA | Higher SLA tier for premium hosting products |
These overrides are configured in the product YAML definition (source of truth) and synced to WooCommerce product meta.
SKU format
Product SKUs follow a structured format:
{ENTITLEMENT_CLASS}-{LINE}[-{PRODUCT}][-{VARIATION}]Examples:
| SKU | Class | Line | Product | Variation |
|---|---|---|---|---|
PLG-MOODLE-FULL | PLG | MOODLE | FULL | -- |
PLG-EXT-SMARTFORMS | PLG | EXT | SMARTFORMS | -- |
SVC-HOST-BASIC | SVC | HOST | BASIC | -- |
EDU-BRIDGE-SESSION | EDU | BRIDGE | SESSION | -- |
The entitlement class prefix in the SKU matches the class mapping, making it easy to identify a product's class at a glance.
Related pages
- The Role of WooCommerce -- boundary between WooCommerce and MIDDAG Account
- Orders and Entitlements -- what happens after a product is purchased
- Renewals -- how renewals affect entitlements
- Entitlement Classes -- class concept reference