Posted on 07/04/2026 10:05:14
This scenario can be partially handled with DynamicWeb 10's built-in discount engine, but the annual per-customer cap requires a small custom extension. Here's how we'd approach it:
Part 1 — 50% staff discount (out-of-the-box)
- Create a Staff user group in Back Office (Users > User Groups).
- Assign all staff customer accounts to that group.
- Create a Discount (eCommerce > Discounts) with:
- Type: Percentage — 50%
- Apply to: All products
- Condition: User group = Staff
- Valid from/to: set to the relevant year window if needed
This covers the core requirement with no custom code.
Part 2 — NOK 8,000 annual cap per customer (custom extension)
DW10 does support a global discount usage limit (MaximumLimits), but this is a shared cap across all users — not per customer. There is no out-of-the-box setting for a per-customer annual spend cap.
The clean solution is a custom DiscountExtenderBase that also implements IDiscountExtenderCalculateOrderDiscount. This is a supported extensibility hook in DW10's discount engine. The extender would:
- Read the current user's ID from the order.
- Query all completed orders placed by that user since 1 January of the current year.
- Sum the discount amounts already granted by this specific staff discount.
- Calculate the remaining budget (NOK 8,000 minus discounts already given).
- Return min(calculated 50% discount, remaining budget) as the final discount amount — meaning the discount is automatically capped when the limit is reached, and partial discount is applied when the customer is close to the limit.
The extender is attached directly to the discount record in Back Office (no deployment required beyond the DLL), and the configured NOK 8,000 limit can be exposed as an add-in parameter so it can be adjusted without code changes.