What you're looking for is typically implemented using the User Points module (that's obvious, and already mentioned in the prior answers).
However, by ALSO using the Goals module (disclosure: I'm its maintainer) you can have the Rules module take care of granting the appropriate number of userpoints. The advantage of using the Goals module, is that you can keep track of all sorts of events that are happening asynchronously (which you cannot do by only using Rules and its events).
So with that it seems that your question (challenge) is reduced to finding a way to configure the appropriate set of Goals and related Tasks. For a basic introduction about Goals, have a look at:
Moreover, it would be straight forward to implement some special reward(s) for something like frequent buyers. Here is what it would take:
- Goal = "New customer", with only 1 Task = "Buy 1 product" (say with machine name =
- Goal = "Silver customer", with Task = "Buy 10 products, on 10 different days, in a timeframe of 3 months".
- Goal = "Gold customer", with Task = "Buy 100 products, on 25 different days, in a timeframe of 12 months".
The interesting part of this is that you'd only have to write 1 rule (related to that machine name =
buy_product) to keep track of the progress of any user to become a new/silver/gold customer (check the video for a similar sample).