The usage should not only be a simple integer field that displays how many times a code has been used, but should also include a transactional log. It makes it possible to keep track on how codes are used, when they are used and other useful data.

I imagine that the data that would be logged could be something like

log_id, message, coupon_id, order_id, change

records in the transaction log could be something like:

1, "Code used by rule FOO on checkout", 1, 1, +1
...
14, "Reset usage count for special promotion deal", 1, NULL, -13

Comments

bojanz’s picture

Usage needs to be rewritten completely in any case...

bojanz’s picture

Issue summary: View changes

We now have the Commerce 2.x implementation (PromotionUsage) that we can backport.