We have implemented a very simple fidlité system.
Each item represents an amount of loyalty points. When you validate an order, the total points of each items is added.
In your account, a menu allows you to view the number of points accumulated on each validated order. These points are then converted into cumulative coupon for your next order.
The calculation of points takes account of the order shipping costs, cumulation is done only on sections of the component.