This is a fringe module. Boxgroove is an organization that deals with golf events, but one of their services is to provide click-through to members, which would be anyone who feels golf is somehow related to their site.
The module captures a code in the incoming query string and stores it as a session variable.
If the user creates a cart, the session variable is stored with the cart (in a separate table).
If the cart becomes an order, the stored value is then marked as being part of that order (and no longer a cart).
If the order is finalized, an appropriate javascript snippet with the value and order total are added to the confirmation page.
What I don't have yet is a strategy for removing the value. If the order is deleted, yes, but otherwise, I need think about removing it when the cart or uncompleted order are removed.
