[ic] Checkout and Userdb

Dan Bergan danb at champonline.com
Mon Jul 19 11:33:03 EDT 2004

Jamie Neil wrote:

> Dan Bergan wrote:
>> Here's how I do it...
>> In /etc/log_transaction, before saving the auto-created user I 
>> changed the email address to be the email address followed by the 
>> order number (so it will always be unique).
>> [if scratch auto_create]
>>    [comment]Change the email address so it doesn't mess up normal 
>> user login[/comment]
>>      [value name=email set="[value email]-[value mv_order_number]"]
>>      [userdb save]
>>    Logout auto-created user: [userdb function=logout clear=0 
>> clear_cart=0]
>> [/if]
> Neat solution.
> Do you do this for any user that it not logged in or just users that 
> have expressed that they don't want to set up an account?
> I'm looking to do something like this site:
> http://www.novascotiancrystal.com/
> (I don't have any affiliation with this site BTW, but I've been told 
> that it was created by a company specialising in usability)
The scratch variable "auto_create" is set earlier when the auto-created 
user account is saved.  So, this code only happens when the customer did 
not log in.  My check out pages give the opportunity to log in or create 
an account, but I do not require it.  If a customer has an account, but 
did not log in, I treat that the same as a customer who has never 
created an account.

When I did this I was a bit more of a newbie, so I was worried about 
messing things up.  So, instead of changing the email address when the 
account is created, I wait until the very end of log_transaction and 
just before logging out I change the email address, update the userdb 
record, then log out.  Now that I'm more comfortable with IC I should 
probably go over the code and see if that extra trip to the database is 
really necessary.


More information about the interchange-users mailing list