Announcement

Collapse
No announcement yet.

Is there any way of capturing the customer's IP address with the order?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is there any way of capturing the customer's IP address with the order?

    It is possible to capture the customer's IP address with the order and display this information in the 'Misc.' tab of the downloaded order. This can be a useful fraud prevention measure as you can get an idea of where in the world the customer is actually ordering from.

    First, go to 'Design | Text | Web Site (cont) | General Information'. Check the 'show' box for the entry 'User Definable 3' and set the 'Prompt' value to 'IP address'

    Now change to the 'Design' tab, and in the 'Select Page Type' drop down list select 'Checkout Page 2'.

    Within the page design, click on the 'IP Address' field. You should be in a layout called 'General User Definable 3'.

    Replace the entire contents of the layout with:

    <input type="hidden" name="GENERALUSERDEFINED" value="<Actinic:Variable Name="GeneralUserDefined"/>" />

    Now locate 'ActinicOrder.pm' within your 'Site1' (or equivalent) folder. Open the file in Notepad.

    Search for 'sub DisplayGeneralPhase'

    Towards the end of this, about 23 lines down, you will see the line:

    $::s_VariableTable{$::VARPREFIX.'GENERALUSERDEFINED'} = ACTINIC::EncodeText2($::g_GeneralInfo{'USERDEFINED'});

    Replace it with:

    # $::s_VariableTable{$::VARPREFIX.'GENERALUSERDEFINED'} = ACTINIC::EncodeText2($::g_GeneralInfo{'USERDEFINED'});
    my $remote_host = $ENV{'REMOTE_HOST'};
    my $remote_addr = $ENV{'REMOTE_ADDR'};
    if (($remote_host eq $remote_addr) || ($remote_host eq '')) {
    $remote_host = gethostbyaddr(pack('C4', split(/\./, $remote_addr)), 2) || $remote_addr;
    }
    $::s_VariableTable{$::VARPREFIX.'GENERALUSERDEFINED'} = $remote_addr . '/' . $remote_host;

    Save the file and exit Notepad. Update the website through Actinic in the usual way.

    After this, when an order is received, the following will be present in the 'Misc' tab:

    IP address:
    <remote IP address>/<remote hostname>

    PLEASE NOTE: This does not currently work with v10 of the software.

    SellerDeck is not able to provide any detailed support for script changes made. If you find that there is a problem, an original copy of the script can be found within the 'Original' folder in your installation. Copy this into your site folder.
Working...
X