easynow Posted August 20, 2014 Share Posted August 20, 2014 Hi, I use this module to get real order ip: http://www.presto-changeo.com/en/prestashop-free-modules/107-order-ip-address-verification.html But there is a problem that I am using a cdn, so the real ip will be HTTP_X_FORWARDED_FOR but not REMOTE_ADDR I got the following code, but I don't know how to insert into this module to make this function come true. <?php if ($_SERVER['HTTP_X_FORWARDED_FOR'] && preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}$/',$_SERVER['HTTP_X_FORWARDED_FOR'])) { $onlineip = $_SERVER['HTTP_X_FORWARDED_FOR']; } elseif ($_SERVER['HTTP_CLIENT_IP'] && preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}$/',$_SERVER['HTTP_CLIENT_IP'])) { $onlineip = $_SERVER['HTTP_CLIENT_IP']; } elseif ($_SERVER['REMOTE_ADDR'] && preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}$/',$_SERVER['REMOTE_ADDR'])) { $onlineip = $_SERVER['REMOTE_ADDR']; } ?> This code makes that: If visitor has HTTP_X_FORWARDED_FOR header, we will get HTTP_X_FORWARDED_FOR ip else HTTP_CLIENT_IP else REMOTE_ADDR Can anyone help? And I wanna this real can replace the one in registere customer log as well. I just attach the module,so you don't need download from presto-changeo.com. orderipaddressverification.zip Link to comment Share on other sites More sharing options...
easynow Posted August 20, 2014 Author Share Posted August 20, 2014 Anyone help? Link to comment Share on other sites More sharing options...
bellini13 Posted August 20, 2014 Share Posted August 20, 2014 you should contact Presto Changeo as the author of the module, they should likely include this into their module and provide you with that support. Link to comment Share on other sites More sharing options...
easynow Posted August 23, 2014 Author Share Posted August 23, 2014 you should contact Presto Changeo as the author of the module, they should likely include this into their module and provide you with that support. They don't reply me. Link to comment Share on other sites More sharing options...
El Patron Posted August 23, 2014 Share Posted August 23, 2014 classes/Tools.php function getRemoteAdd will do this for you. Link to comment Share on other sites More sharing options...
Recommended Posts