Commerce - how to allow users to buy 2 free products For a current site I am building, authenticated users should be able to order 2 free products (of a certain type), after which the prices are back up to full price. Is there any solution which allows this kind of functionality? I can't seem to find the right words to search as nothing is coming up.

If not, any ideas on how to implement this with Rules / code?

I imagine I would have to add a new line item for the 2 free tickets at $0, and deduct these 2 products from the original line item, but I'm not sure at what stage in the process to do this. Any help?
By using the Goals module (disclosure: I'm its maintainer) you can have the Rules module take care of "monitoring users about buying their first 2 products" (as in your question). 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:


How to implement gamification in a Drupal site and award incentives?
Its video tutorial.


Here is what it would take to implement something like a frequent buyers program:


Goal = "New customer", with only 1 Task = "Buy 1 product" (say with machine name = buy_product).
Goal = "Existing customer", with Task = "Buy 2 products".


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 either a "new" or "existing" customer (check the video for a similar sample).

Homework: how should a rule look like to indicate that a user bought a product (either the very first one, or yet another one)?