Jump to content

Adding Column to Sessions Table


Guest Stephen Lilly

Recommended Posts

Guest Stephen Lilly

Hi,

I would like to add a new column (CustomerIP) to the cubecart_sesions table inorder to record the customers IP address ..

Can anyone help with advising the appropiate MySQL command

Thank you

Stephen

Link to comment
Share on other sites

You're not exactly recording the customer's IP address. You are recording the anonymous visitor's IP address in a session state that persists with this visitor's visit, even if that visitor eventually logs in and acquires a customer ID number. (I think.)

Even so, CC will delete sessions older than that as specified in the admin settings.

And CC records the IP address of the machine used to place an order.

There's a third party mod (I think) that displays the IP address as a visitor moves about the store.

But, to answer your specific question (without actually having tested this):

/includes/session.inc.php, line 87:

Here is a group of statements that prepares the associative array $sessData. Add this line after this group:

$sessdata["visitorIP"] = $_SERVER['REMOTE_ADDR'];

Be sure there's a field in the CubeCart_sessions table called 'visitorIP'.

Now, the next obvious question is, where do you want to display this information?

Link to comment
Share on other sites

Guest Stephen Lilly

Hi

Thank you for your reply...

I am trying to understand how to add an extra column in the sessions table to temporally add the visitor information...

This would then be displayed on the Stats page

I belive the SQL cmd is something like ALTER TABLE cubecart_sessions, followed by ADD CistomerIP....however this just produces an error

Thank you

Stephen

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...