Jump to content

Where are guest ip addresses stored in the database? SOLVED


bnadauld

Recommended Posts

SOLVED - I upgraded my store to 8 and installed reCAPTCHA Free v1.1.3 - by PrestaHero


I can see the ip address of guests in BO - stats - visitor ids screen. But when i go to ps_connection in the db the ip_address column is garbled?

or (even better) does anyone know of a sql query that will cross check a customer order with their ip address. Ive got a non paying customer and i'd like to pull their ip address.

Thanks

 

1.png

2.png

Edited by bnadauld (see edit history)
  • Like 1
Link to comment
Share on other sites

This way you can find it by customer number, by order number or by customer email.

Otherwise, there is also the option to edit PaymentModule.php or Order.php and save the IP address in the ps_orders table (add column).
But that's something else.

SELECT a.id_order, a.id_customer, b.id_guest, c.ip_address, c.date_add, d.email 
FROM ps_orders a
LEFT JOIN ps_guest b ON (a.id_customer = b.id_customer)
LEFT JOIN ps_connections c ON (b.id_guest = c.id_guest)
LEFT JOIN ps_customer d ON (a.id_customer = d.id_customer)
WHERE d.email = '[email protected]' OR a.id_customer = 3 OR a.id_order = 3
ORDER BY c.ip_address
Link to comment
Share on other sites

16 hours ago, Guest said:

This way you can find it by customer number, by order number or by customer email.

Otherwise, there is also the option to edit PaymentModule.php or Order.php and save the IP address in the ps_orders table (add column).
But that's something else.


SELECT a.id_order, a.id_customer, b.id_guest, c.ip_address, c.date_add, d.email 
FROM ps_orders a
LEFT JOIN ps_guest b ON (a.id_customer = b.id_customer)
LEFT JOIN ps_connections c ON (b.id_guest = c.id_guest)
LEFT JOIN ps_customer d ON (a.id_customer = d.id_customer)
WHERE d.email = '[email protected]' OR a.id_customer = 3 OR a.id_order = 3
ORDER BY c.ip_address

appreciate that - thanks - worked perfectly

note for anyone else that reads this: I had to keep the ' ' around the email address part as my sql syntax was different(?)

Edited by bnadauld (see edit history)
Link to comment
Share on other sites

  • 4 years later...
  • 3 weeks later...
  • bnadauld changed the title to Where are guest ip addresses stored in the database? SOLVED

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...