[ic] Keeping track of how much a user has spent...

Russ Mann interchange-users@interchange.redhat.com
Tue Jan 22 14:16:01 2002


Hello,

I want to keep track of how much money a user has spent on my store in his
userdb record.  In the log_transaction file, I figured I could hijack the
credit_limit function and just reverse it.

There is a line like this:
[seti total_cost][total-cost noformat=1][/seti]

then the Add main order data lines...

Then this:

set credit_limit: [seti credit_limit][data
		table=userdb
		col=credit_limit
		key="[data session username]"
		value="[scratch total_cost]"
		increment=1
		][/seti]

Seems like it would work right?  Well, it doesn't.

I think it has something to do with a [userdb save] going on in the
receipt.html file (to make sure that all the users newly entered data is
saved), possibly overwriting the value with the old scratch value.  Is there
a better way to do this?

-Russ