Get country name in Admin Edit Order Page from customer IP
-
Woocommerce version: 3.2.3
Currently the Admin Order edit page shows the following details in the heading:
Order #440 details
Payment via Check payments. Customer IP: 5.39.114.85
See screenshot See Screenshot
Using geolocation from MaxMind GeoIP database would it be possible to add country name linked to the IP?In this example, this IP: 5.39.114.85 points to
IP Address 5.39.114.85
Host 5.39.114.85
Country Finland
Latitude 60°10’14” N
Longitude 24°56’15” EI understand that the IP information is referenced from
https://github.com/woocommerce/woocommerce/blob/387093cd27f097c71b2fcb4bfd73362d058c3ed9/includes/admin/meta-boxes/class-wc-meta-box-order-data.php#L209
with the following code
if ( $ip_address = $order->get_customer_ip_address() ) { /* translators: %s: IP address */ $meta_list[] = sprintf( __( 'Customer IP: %s', 'woocommerce' ), '<span class="woocommerce-Order-customerIP">' . esc_html( $ip_address ) . '</span>' ); }
This would help detect possible fraud in case there is an obvious mismatch between this country name and billing / shipping country.
I understand that customer’s using a proxy would render this useless but still it might help.
I also use GeoIP Detection plugin, if it helps.
Thanks a lot!
- The topic ‘Get country name in Admin Edit Order Page from customer IP’ is closed to new replies.