This is an easy mod to allow you to search IP addresses in your orders.
This is helpful to locate customers who leave reviews, or match orders. We also look in the admin log and see failed payment attempts, and we can look up those orders now.
One more I just thought about. If we ban an IP address, we can search orders for that IP to recall who it was we banned. Assuming they had placed an order at one time.
Below, see versions for both .asp and .php versions.
While this is a modification to one of the core files and will get overwritten by updates, it's also easy to do, and it's fully commented so it's a breeze to use a file compare program when new updates come out, to reinstall this.
If you forget to install it when you update, nothing bad happens, you just can't search IP addresses untill you reinstall it.
ECT has a page here https://www.ecommercetemplates.com/tutorials/updating.html that explains updating with mods
*********************************************************************************************************
===.asp version.===
Two small entries in the vsadmin/inc/incorders.asp page
Make a backup of the file before making changes.
If you use an alternate folder other than vsadmin for working with your back end, then the file will be
myhiddenfolder/inc/incorders.asp
:::STEP ONE:::
In version 7.0.0, it's about line 360, but search for
elseif ordersearchfield="zip" thenand that will find the area where we need to insert 2 new lines.
(with commenting, it's 4 lines we will insert)
change this
elseif ordersearchfield="invoice" then
whereSQL=whereSQL & " AND ordInvoice LIKE '%"&searchtext&"%'"
elseif ordersearchfield="tracknum" then
whereSQL=whereSQL & " AND ordTrackNum LIKE '%"&searchtext&"%'"
elseif ordersearchfield="affiliate" then
whereSQL=whereSQL & " AND ordAffiliate='"&searchtext&"'"
to this (new lines in red)
elseif ordersearchfield="invoice" then
whereSQL=whereSQL & " AND ordInvoice LIKE '%"&searchtext&"%'"
elseif ordersearchfield="tracknum" then
whereSQL=whereSQL & " AND ordTrackNum LIKE '%"&searchtext&"%'"
'2 lines below added to search for IP address
elseif ordersearchfield="ipadrss" then
whereSQL=whereSQL & " AND ordIP LIKE '%"&searchtext&"%'"
'2 lines above added to search for IP address
elseif ordersearchfield="affiliate" then
whereSQL=whereSQL & " AND ordAffiliate='"&searchtext&"'"
:::STEP TWO:::
In version 7.0.0, it's about line 3085, but search for
<option value="phone"and that will find the area where we need to insert 1 new line.
(with commenting, it's 3 lines we will insert)
change this
<option value="phone" <% if ordersearchfield="phone" then print "selected=""selected"""%>><%=yySearch&" "&yyTelep%></option>
<option value="invoice" <% if ordersearchfield="invoice" then print "selected=""selected"""%>><%=yySearch&" "&yyInvNum%></option>
to this (new lines in red)
<option value="phone" <% if ordersearchfield="phone" then print "selected=""selected"""%>><%=yySearch&" "&yyTelep%></option>
<!末 below line added for IP address search 末>
<option value="ipadrss" <% if ordersearchfield="ipadrss" then print "selected=""selected"""%>><%=yySearch&" IP Address"%></option>
<!末 above line added for IP address search 末>
<option value="invoice" <% if ordersearchfield="invoice" then print "selected=""selected"""%>><%=yySearch&" "&yyInvNum%></option>
Save, upload the file and you now have the option to search IP addresses in your admin orders page.
*************************************************************************************************************
===.php version.===
Two small entries in the vsadmin/inc/incorders.php page
Make a backup of the file before making changes.
If you use an alternate folder other than vsadmin for working with your back end, then the file will be
myhiddenfolder/inc/incorders.php
:::STEP ONE:::
In version 6.9.4, it's about line 341, but search for
elseif($ordersearchfield=='zip')and that will find the area where we need to insert 2 new lines.
(with commenting, it's 4 lines we will insert)
change this
elseif($ordersearchfield=='invoice')
$whereSQL.=" AND ordInvoice LIKE '%" . $searchtext . "%'";
elseif($ordersearchfield=='tracknum')
$whereSQL.=" AND ordTrackNum LIKE '%" . $searchtext . "%'";
elseif($ordersearchfield=='affiliate')
$whereSQL.=" AND ordAffiliate='" . $searchtext . "'";
to this (new lines in red)
elseif($ordersearchfield=='invoice')
$whereSQL.=" AND ordInvoice LIKE '%" . $searchtext . "%'";
elseif($ordersearchfield=='tracknum')
$whereSQL.=" AND ordTrackNum LIKE '%" . $searchtext . "%'";
//below lines added to search for IP address
elseif($ordersearchfield=='ipadrss')
$whereSQL.=" AND ordIP LIKE '%" . $searchtext . "%'";
//above lines added to search for IP address
elseif($ordersearchfield=='affiliate')
$whereSQL.=" AND ordAffiliate='" . $searchtext . "'";
:::STEP TWO:::
In version 6.9.4, it's about line 2889, but search for
<option value="phone"and that will find the area where we need to insert 1 new line.
(with commenting, it's 3 lines we will insert)
change this
<option value="phone" <?php if($ordersearchfield=='phone') print 'selected="selected"'?>><?php print $yySearch.' '.$yyTelep?></option>
<option value="invoice" <?php if($ordersearchfield=='invoice') print 'selected="selected"'?>><?php print $yySearch.' '.$yyInvNum?></option>
to this (new lines in red)
<option value="phone" <?php if($ordersearchfield=='phone') print 'selected="selected"'?>><?php print $yySearch.' '.$yyTelep?></option>
<!末 below line added for IP address search 末>
<option value="ipadrss" <?php if($ordersearchfield=='ipadrss') print 'selected="selected"'?>><?php print $yySearch.' IP Address'?></option>
<!末 above line added for IP address search 末>
<option value="invoice" <?php if($ordersearchfield=='invoice') print 'selected="selected"'?>><?php print $yySearch.' '.$yyInvNum?></option>
Save, upload the file and you now have the option to search IP addresses in your admin orders page.
This has been fully tested in both .asp and .php versions.
Enjoy,
David