Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 Advanced Tips and Tricks - NO QUESTIONS PLEASE
 IP Address search admin orders .asp and .php MOD
Author « Topic »  

dbdave
ECT Moderator

USA
10373 Posts

Posted - 10/02/2018 :  17:56:33  
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" then
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" 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



Edited by - dbdave on 10/02/2018 18:02:57

midvalleydrifter001
Ecommerce Template Expert

USA
930 Posts

Posted - 10/02/2018 :  20:45:13  
Thank you so much.

I've been wanting this option for a long time.

It works perfectly.

Thanks again.

Patrick

dbdave
ECT Moderator

USA
10373 Posts

Posted - 10/02/2018 :  21:42:11  
You're welcome Patrick.
We don't use it every single day, but when we do need it, it's nice to have.

xyz1
Advanced Member

United Kingdom
166 Posts

Pre-sales questions only
(More Details...)

Posted - 10/03/2018 :  01:35:08  
Many thanks for this David.

It's a very useful facility to have.

Your help and efforts are appreciated.

Neil

steven vaccaro
Ecommerce Template Guru

USA
1030 Posts

Posted - 10/11/2018 :  06:52:53  
This works great!!!! Thanks!

steven vaccaro
Ecommerce Template Guru

USA
1030 Posts

Posted - 08/31/2023 :  14:30:14  
Dave can this be used with the latest versions of the cart?

midvalleydrifter001
Ecommerce Template Expert

USA
930 Posts

Posted - 08/31/2023 :  16:21:45  
I use it with ECT 7.6.2 with no problems.

Patrick

  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000