Jump to content
Sign in to follow this  
The Luke

IP in Contact Form.

Recommended Posts

Hello,
How to add IP address of customers that send me emails over contact for.
I want to have their IP addresses in mails that they send to me ?

Thank you

Share this post


Link to post
Share on other sites

Not a problem...

Open: contact-form.php
Find:

        if (intval($cookie->id_customer))
           $customer = new Customer(intval($cookie->id_customer));
       if (Mail::Send(intval($cookie->id_lang), 'contact', 'Message from contact form', array('{email}' => $_POST['from'], '{message}' => stripslashes($message)), $contact->email, $contact->name, $from, (intval($cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : $from)))


Replace with:

        $ip_address = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : $REMOTE_ADDR;

       if (intval($cookie->id_customer))
           $customer = new Customer(intval($cookie->id_customer));
       if (Mail::Send(intval($cookie->id_lang), 'contact', 'Message from contact form', array('{email}' => $_POST['from'], '{ip_address}' => $ip_address, '{message}' => stripslashes($message)), $contact->email, $contact->name, $from, (intval($cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : $from)))



Open: mails/contact.html
Find:

                E-mail address: {email}



Replace with:

                E-mail address: {email}



               IP address: {ip_address}


Share this post


Link to post
Share on other sites

Hi!

 

What should be changed in

prestashop version : 1.4.5.1 ?????

 

Thank you

Share this post


Link to post
Share on other sites

i opened the contact-form.php

 

but can't find those lines...

 

any idea please?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More