Post by OpenCode » Tue Oct 23, 2018 8:28 am

Hi Everyone!
Fining order by duplicate IP address - Like to know how many orders came from the same IP.
I'm trying to get all duplicate IP and display all orders that are coming from the same IP address.

the code below is the one I'm using but is not doing the trick I get an error

Code: Select all

public function duplicates($ip){
		$query = $this->db->query("SELECT ip FROM " . DB_PREFIX . "order WHERE ip = '".$this->db->escape($ip)."'");
		return $query->num_rows;
when I

Code: Select all

I can see the list of IP address but I can not get then to displayed.

I only need to display the last 1 to 5 orders from the same IP address that's all.

can anyone help me in solving the problem - I'm not good on db query LOL.

let me know any advice - this is for order list

Thank you

New member


Fri Jun 07, 2013 9:31 am

Post by IP_CAM » Tue Oct 23, 2018 9:39 am

Are you aware of the Fact, that Customer do not always have the same IP Number !? ;)
So, it would not make much sense, trying to make some Listing out of it, I assume ...

For Sale: Turnkey URLs with Opencart installed!
Ernie's present Opencart Testsite:
Attacker IP Blocks are denied from further access to my Sites!
Just contact me for more Information at:
665 FREE OC Extension-Repositories - from OC v.1.5.x up
on the largest Opencart-Mod Github Site:

User avatar
Legendary Member


Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by ostechnologies » Tue Oct 23, 2018 2:22 pm

Try using this code, it will provide the array of top 5 orders from same ip

public function duplicates($ip){
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order WHERE ip = '".$this->db->escape($ip)."' LIMIT 5");
return $query->rows;

Opencart Expert | sales[at]
Skype - manish.osuniverse | Gtalk - manishmt

Extensions for Opencart @ ... extensions - ecommerce website design, development and digital company

User avatar
Active Member


Mon Apr 06, 2015 1:30 pm

Post by OpenCode » Thu Oct 25, 2018 3:57 am

@ IP CAM, yes we know that but when there are multiple orders from the same IP Address these order can end up as Fraudulent.
by tracking orders via IP we can lower the risk.

@ ostechnologies,

Thank you I will try that, by Limited to 5.

Thank you for your help and advice.

New member


Fri Jun 07, 2013 9:31 am
Who is online

Users browsing this forum: No registered users and 28 guests