| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Display Customer IP during checkout | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Display Customer IP during checkout
First, my apologies if this has been addressed elsewhere - I've searched and seen the posts regarding capturing the IP address for back-end purposes but hadn't seen anything quite exactly like this.
Also this may seem a bit pretentious to post in Custom Mods, (it's just a simple hack) so moderators please feel free to move to more appropriate forum. It is also a good example/excercise of how you can use your own "pseudo" variables in any of your language variables. Say for instance, you would like to display to a customer during checkout that their IP address is part of your anti-fraud technology - please, let's skip the debate as to whether this is useful or not; some clients want this based on the high-risk markets they are in and feel it is at least a minor deterrent. Okay, first create a new text label: Administration -> Languages -> Select Language -> Select Topic -> Text For variable put: msg_customer_IP For Description put: Customer IP address For Value use something like this (note the double curly brackets around the word customer_ip: Code:
Then to display this information wherever you want, use: Code:
The "substitute" pipe replaces your pseudo variable "customer_ip" with the smarty global containing the remote IP address. Credits go to PhilJ for putting me on to the smarty global thing: http://forum.x-cart.com/viewtopic.php?t=14490&highlight=remoteaddr I was trying to use a PHP global and couldn't get it to work quite right. Thanks Phil |
|||||||
#2
|
|||||||
|
|||||||
isn't this IP already intergrated with latest version?
if you go to order and click on whatever order you wanted you wil lsee just under status: and tracking number: IP address: xxx.xxx.xxx.xxx
__________________
X-Cart version 4.x (Most likely will be the latest version) |
|||||||
#3
|
|||||||
|
|||||||
x-online,
Please read my post and its purpose carefully - this is for display to customer during checkout |
|||||||
#4
|
|||||||
|
|||||||
Sorry for my misreading ^_^''
Nice work!
__________________
X-Cart version 4.x (Most likely will be the latest version) |
|||||||
#5
|
|||||||
|
|||||||
small change
i just implemented this and had to make one small change. the code:
Code:
should be: Code:
__________________
software: x-cart pro, Version 4.0.15 operating system: FreeBSD 5.4 |
|||||||
#6
|
|||||||||
|
|||||||||
I don't think the default takes Proxies or IP's behind LAN's into consideration. Here's a function that can easily be used in config.php to grab the absolute IP of the user. Thanks to NuLime for the function.
Code:
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
|
#7
|
|||||||
|
|||||||
Dear Boomer,
Where exactly to put this code in config.php ? We need to just put this code & nothing else ? will it display the customer's original IP on chekout ?
__________________
X-Cart: 4.7.7 LIVE Skin:Ultra by xcartmods.co.uk X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9) --------------- Server: Linux php: 5.3 mysql: 5.0.89 ---------------- |
|||||||
#8
|
|||||||||
|
|||||||||
Quote:
Place it towards the bottom of the file, before the WARNING comment. Add this afterwards to call the IP anywhere: Code:
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#9
|
|||||||
|
|||||||
Place it towards the bottom of the file, before the WARNING comment.
Add this afterwards to call the IP anywhere: Code: $smarty->assign("customers_ip", fetch_remote_address()); And call the variable in any .tpl {$customers_ip} Boomer, what do you mean by "And call the variable in any .tpl {$customers_ip}" I copied the code into config like you said and added the line afterwards, but I'm still not seeing an IP. Thanks.[/quote]
__________________
jbart976 X-Cart 4.0.12 |
|||||||
#10
|
|||||||||
|
|||||||||
Code:
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|