Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Collecting Customer's IP address during checkout - why is everyone 172.16.10.1 ?

    The orders class, which feeds the payment modules (if they're smart enough to use the supplied data), should already be using the zen_get_ip_address() function.

    Perhaps your addon payment module is not written as smartly, and is using REMOTE_ADDR instead of zen_get_ip_address() ? In which case, you'd only need to change that file.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #12
    Join Date
    Aug 2004
    Location
    Fountain Hills, AZ
    Posts
    515
    Plugin Contributions
    1

    Default Re: Collecting Customer's IP address during checkout - why is everyone 172.16.10.1 ?

    I made the changes in functions and nothing changed (still bad incoming IPs) but I also changed it in customer tracking mod and broke the site..arggg . I'm going to create a test site with a clean set of files in a subdirectory and play with this there. I can't keep breaking the live site.. really bad protocol.

    Thanks for your help.

    Ruth

  3. #13
    Join Date
    Aug 2004
    Location
    Fountain Hills, AZ
    Posts
    515
    Plugin Contributions
    1

    Default Re: Collecting Customer's IP address during checkout - why is everyone 172.16.10.1 ?

    Quote Originally Posted by DrByte View Post
    The orders class, which feeds the payment modules (if they're smart enough to use the supplied data), should already be using the zen_get_ip_address() function.

    Perhaps your addon payment module is not written as smartly, and is using REMOTE_ADDR instead of zen_get_ip_address() ? In which case, you'd only need to change that file.
    If I understand this post correctly - if I check the USAePay module and make the change there we should get the corrected IP? That said, in the admin - orders - even on a check/money order the IP is incorrect. Its an IP that is being thrown by my customer's server not the originating purchasers IP....

    I'll start doing a search to find all occasions of this code and see where we are..

    Thanks again.

    Ruth

  4. #14
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Collecting Customer's IP address during checkout - why is everyone 172.16.10.1 ?

    Three basic places should cover most of your issues, in addition to the functions_general change you made and any required changes to your epay module:

    In /includes/application_top.php, near the end of the file, change this line:
    Code:
    $customers_ip_address = $_SERVER['REMOTE_ADDR'];
    to this:
    Code:
    $customers_ip_address = zen_get_ip_address();
    For whos_online, change includes/functions/whos_online.php:
    Code:
      $wo_ip_address = (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'Unknown');
    to:
    Code:
      $wo_ip_address = zen_get_ip_address();
    For the footer, change your template file tpl_footer.php:
    Code:
    <div id="siteinfoIP"><?php echo TEXT_YOUR_IP_ADDRESS . '  ' . $_SERVER['REMOTE_ADDR']; ?></div>
    to:
    Code:
    <div id="siteinfoIP"><?php echo TEXT_YOUR_IP_ADDRESS . '  ' . zen_get_ip_address(); ?></div>
    And strongly evaluate why you moved to this particular host


    Fortunately, the upcoming 1.4.0 version of Zen Cart has more central control over this.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #15
    Join Date
    Aug 2005
    Posts
    154
    Plugin Contributions
    0

    Default Re: Collecting Customer's IP address during checkout - why is everyone 172.16.10.1 ?

    Got a similar issue! The IP address on the customer invoice is incorrect and showing the wrong internal private IP.

    I already edited the zen_get_ip_address() function and now it is giving the proper IP address (I tested this by calling the get_ip_address() function and showing that in the footer and it does indeed show the correct IP address for that user).

    So then that should have fixed the problem, but it didn't! Still wrong IP address showing up on the invoice. What does that mean... I think it isn't calling that function in whatever file writes the IP on the invoice and it is hardcoded to $_SERVER['remote_addr'].

    Dr Byte, you mentioned "the orders class, which feeds the payment modules should already be using the zen_get_ip_address() function"... do you know this for a fact? What file can I look at to see this?

    Basically my question is: What file writes the IP address on the customer's order? If I knew that I could have it reference the get_ip_address() function and since that provides the correct IP all will work properly.

    Apprecaite your help guys!

  6. #16
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Collecting Customer's IP address during checkout - why is everyone 172.16.10.1 ?

    If you've updated application_top as I posted previously, it should be fine.

    This line in /includes/classes/order.php is what stores the IP address information. It is two addresses: the first one is the customer ip address as set in application_top, and the second is the IP address detected at the time of order completion. You could change the second one if you desire by using the zen_get_ip_address function there too ... but that does defeat the purpose of the two separate addresses (the second one is technically intended to find out whether the payment was completed via a 3rd-party site such as PayPal etc)
    Code:
                                'ip_address' => $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR']
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #17
    Join Date
    Aug 2005
    Posts
    154
    Plugin Contributions
    0

    Default Re: Collecting Customer's IP address during checkout - why is everyone 172.16.10.1 ?

    DrByte, you're the man! I missed that file to edit, and just to reitterate it was the /includes/application_top.php file that needed editing and once you do that it will all work gravy!!!

    Thanks :-)

  8. #18
    Join Date
    Apr 2011
    Posts
    1
    Plugin Contributions
    0

    Default Re: Collecting Customer's IP address during checkout - why is everyone 172.16.10.1 ?

    Hi everyone

    I am a newbie to Zen cart.. and so far it is working great (moved from another "caffeine fueled" shop )

    The major issue I have is the same as these posts, namely that every single visitors ip addy is displayed as 10.216.1.63 in every area that displays the ip address !

    I have tried the suggestions that everyone has been good enough to post here but to no avail.

    I am using the latest build 1.39h

    Thanks in advance !

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 2
    Last Post: 24 Jun 2014, 06:18 AM
  2. v138a Why doesn't my coupon box display during checkout?
    By ribow in forum General Questions
    Replies: 0
    Last Post: 26 Jun 2012, 07:49 AM
  3. Replies: 6
    Last Post: 8 Mar 2012, 06:36 PM
  4. If address is missing during checkout
    By vera in forum Managing Customers and Orders
    Replies: 2
    Last Post: 7 Apr 2008, 11:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR