calgaryx Posted November 23, 2024 Share Posted November 23, 2024 (edited) Hi there. i am using Prestashop 8.2. Is it possible to include customer ip address when non registered customer contact me using customer contact form? Thanks Edited November 27, 2024 by calgaryx (see edit history) Link to comment Share on other sites More sharing options...
webprog Posted November 23, 2024 Share Posted November 23, 2024 Hello, you will need to make changes to the contact form module's code for this functionality. Link to comment Share on other sites More sharing options...
calgaryx Posted November 23, 2024 Author Share Posted November 23, 2024 5 hours ago, webprog said: Hello, you will need to make changes to the contact form module's code for this functionality. Thanks for your replay. But i how i can do it? Hints, suggestion please? Thanks Link to comment Share on other sites More sharing options...
webprog Posted November 23, 2024 Share Posted November 23, 2024 (edited) You can use similar example but for prestashop 1.7 and for captcha in contact form: https://webproggi.com/en/prestashop-category/installation-google-recaptcha-v3-to-contact-form-prestashop-1-7.html Edited November 23, 2024 by webprog (see edit history) Link to comment Share on other sites More sharing options...
calgaryx Posted November 23, 2024 Author Share Posted November 23, 2024 1 hour ago, webprog said: You can use similar example but for prestashop 1.7 and for captcha in contact form: https://webproggi.com/en/prestashop-category/installation-google-recaptcha-v3-to-contact-form-prestashop-1-7.html Thanks for your replay. I have installed module Google recaptcha v3. It works good. But with current customer contact module anybody can send you a letter...spam you.. You can not do anything about it. But if if you have their ip address at list you can block (ban) that person. Link to comment Share on other sites More sharing options...
WebDesk Solution Posted November 26, 2024 Share Posted November 26, 2024 @calgaryx To add an IP address in the email please install the below module and make some changes in a mail template file. Please attached module.Modify your contact.html and contact.txt templates to include the {customer_ip} placeholder.contact.htmlSyntax: <tr> <td align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-size: 0px; padding: 10px 25px; padding-top: 0px; word-break: break-word;"> <div style="font-family:Open sans, arial, sans-serif;font-size:16px;line-height:25px;text-align:left;color:#363A41;" align="left"> <span class="label" style="font-weight: 700;">Customer IP:</span> <span> {customer_ip}</span> </div> </td> </tr> Screenshot: https://prnt.sc/hFzKNpK88Qt0 contact.txtSyntax: Customer IP: {customer_ip}Screenshot: https://prnt.sc/WmZNikADQz1q Clear your PrestaShop cache from the back office (Advanced Parameters > Performance > Clear Cache). Submit the contact form and verify that the emails now include the Customer IP. ps_contact_form_ip.zip Link to comment Share on other sites More sharing options...
calgaryx Posted November 27, 2024 Author Share Posted November 27, 2024 9 hours ago, WebDesk Solution said: @calgaryx To add an IP address in the email please install the below module and make some changes in a mail template file. Please attached module.Modify your contact.html and contact.txt templates to include the {customer_ip} placeholder.contact.htmlSyntax: <tr> <td align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-size: 0px; padding: 10px 25px; padding-top: 0px; word-break: break-word;"> <div style="font-family:Open sans, arial, sans-serif;font-size:16px;line-height:25px;text-align:left;color:#363A41;" align="left"> <span class="label" style="font-weight: 700;">Customer IP:</span> <span> {customer_ip}</span> </div> </td> </tr> Screenshot: https://prnt.sc/hFzKNpK88Qt0 contact.txtSyntax: Customer IP: {customer_ip}Screenshot: https://prnt.sc/WmZNikADQz1q Clear your PrestaShop cache from the back office (Advanced Parameters > Performance > Clear Cache). Submit the contact form and verify that the emails now include the Customer IP. ps_contact_form_ip.zip 10.21 kB · 1 download It works like a charm. Thank you very much. Link to comment Share on other sites More sharing options...
calgaryx Posted December 1, 2024 Author Share Posted December 1, 2024 On 11/26/2024 at 8:27 AM, WebDesk Solution said: @calgaryx To add an IP address in the email please install the below module and make some changes in a mail template file. Please attached module.Modify your contact.html and contact.txt templates to include the {customer_ip} placeholder.contact.htmlSyntax: <tr> <td align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-size: 0px; padding: 10px 25px; padding-top: 0px; word-break: break-word;"> <div style="font-family:Open sans, arial, sans-serif;font-size:16px;line-height:25px;text-align:left;color:#363A41;" align="left"> <span class="label" style="font-weight: 700;">Customer IP:</span> <span> {customer_ip}</span> </div> </td> </tr> Screenshot: https://prnt.sc/hFzKNpK88Qt0 contact.txtSyntax: Customer IP: {customer_ip}Screenshot: https://prnt.sc/WmZNikADQz1q Clear your PrestaShop cache from the back office (Advanced Parameters > Performance > Clear Cache). Submit the contact form and verify that the emails now include the Customer IP. ps_contact_form_ip.zip 10.21 kB · 3 downloads Hi there. It's me again. I have two domain. Two webshop installation. Like i mention before on first i setup without problems. It worked like a charm. I try to setup on my another webshop installation. Follow same proceeders. Basicaly copied already working contact.html and contact.txt files. Cleared cache. But nothing happened. No efect. Any idea why....? Could Cloudfare caching or something else? Thanks Link to comment Share on other sites More sharing options...
WebDesk Solution Posted December 2, 2024 Share Posted December 2, 2024 @calgaryx Okay, as per your last comment, I have made the changes in both files, but it had no effect. Please check the files located in this directory: themes/{{your_theme}}/mails/{{your_language_code}}, and apply the same changes to those files. Link to comment Share on other sites More sharing options...
calgaryx Posted December 3, 2024 Author Share Posted December 3, 2024 On 12/2/2024 at 6:17 AM, WebDesk Solution said: @calgaryx Okay, as per your last comment, I have made the changes in both files, but it had no effect. Please check the files located in this directory: themes/{{your_theme}}/mails/{{your_language_code}}, and apply the same changes to those files. Thanks for your help. I really apricate. It working now. Thanks again. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now