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

var_dump($ip);
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
Opencart 3.0.2.0

Thank you
everyone!

New member

Posts

Joined
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 ...
Ernie

For Sale: Top URL's, including an OpenCart V-Pro Shop!
A wide range of matching Designs can be seen here: http://www.opencart.li
For Information on URL's offered, please contact me at: jti@jacob.ch
Hundreds of Mods in 380+ Repositories for OC v.1.5.x - v.2.3.x
to be found on my Github Site: https://github.com/IP-CAM
Image


User avatar
Legendary Member

Posts

Joined
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]ost.agency
Skype - manish.osuniverse | Gtalk - manishmt

Extensions for Opencart @ https://www.ost.agency/product/product- ... extensions
ost.agency - ecommerce website design, development and digital company


User avatar
Active Member

Posts

Joined
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

Posts

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

Users browsing this forum: No registered users and 13 guests