Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2005
    Location
    Captain Cook, Hawaii
    Posts
    179
    Plugin Contributions
    0

    Default Customer Data Corrupted after server error

    Many months ago, we had a server error and part of the customer data was corrupted in the address book part of the SQL file we used to recover from. 100 entries in the address book had to matched up to the Customers set to the Address Book. I thought I also set the DEFAULT ADDRESS IDs but I am seeing some still at 0 for 100 customers. Some returning customers were having to go in and set one of their address to DEFAULT to fix the problem.

    Rather than try to patch this as their may be another problem, how best can I delete all customers? I understand we would lose all historical order data, etc.
    Aloha from Hawaii! (its a dirty job, but SOMEBODY has to live here...)

  2. #2
    Join Date
    Feb 2005
    Location
    Captain Cook, Hawaii
    Posts
    179
    Plugin Contributions
    0

    Default Re: Customer Data Corrupted after server error

    For what it is worth, all orders go through PayPal from the cart. I wonder if there might be a way to force any customer to be a guest and just let PayPal handle it?
    Aloha from Hawaii! (its a dirty job, but SOMEBODY has to live here...)

  3. #3
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Customer Data Corrupted after server error

    Are you saying that AFTER you manually fixed those 100 records, they are suddenly now NOT fixed? ie: set back to 0 again?
    Or are you saying you missed some?
    .

    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.

  4. #4
    Join Date
    Feb 2005
    Location
    Captain Cook, Hawaii
    Posts
    179
    Plugin Contributions
    0

    Default Re: Customer Data Corrupted after server error

    I THOUGHT I fixed them back in march. I see some today at zero. They are existing customers.

    I think the problem was that oftentimes a customer had multiple shipping addresses and I did not want to manually choose one to be their default because it might have been an address they shipped to that was not theirs.

    I also had no easy way to force those customers to go into their book and set a default. I added a notice at checkout for them to review the entries upon checkout.

    What I suspect is happening is that Paypal allows them to check out by bypassing Zencarts initial cart checkout procedure (where the big warning is to verify their address), or they are not manually filling out the default address setting for their shipping address.

    Is there a way to just force them that if their default shipping address is 0 to have to fix their address?

    Other than the address issues for existing customers, the rest of the cart has been working with no other errors.

    In no easy way to force the customer to update and/or fix their address, or should I just delete those customers effected?
    Aloha from Hawaii! (its a dirty job, but SOMEBODY has to live here...)

  5. #5
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    557
    Plugin Contributions
    0

    Default Re: Customer Data Corrupted after server error

    Quote Originally Posted by mshultise View Post
    I THOUGHT I fixed them back in march. I see some today at zero. They are existing customers.

    I think the problem was that oftentimes a customer had multiple shipping addresses and I did not want to manually choose one to be their default because it might have been an address they shipped to that was not theirs.

    I also had no easy way to force those customers to go into their book and set a default. I added a notice at checkout for them to review the entries upon checkout.

    What I suspect is happening is that Paypal allows them to check out by bypassing Zencarts initial cart checkout procedure (where the big warning is to verify their address), or they are not manually filling out the default address setting for their shipping address.

    Is there a way to just force them that if their default shipping address is 0 to have to fix their address?

    Other than the address issues for existing customers, the rest of the cart has been working with no other errors.

    In no easy way to force the customer to update and/or fix their address, or should I just delete those customers effected?
    if you still have missing addresses...can you use the old addresses stored in the old orders to help fix it?

  6. #6
    Join Date
    Feb 2005
    Location
    Captain Cook, Hawaii
    Posts
    179
    Plugin Contributions
    0

    Default Re: Customer Data Corrupted after server error

    If I want to do it manually. There are perhaps 100 people to fix.
    Aloha from Hawaii! (its a dirty job, but SOMEBODY has to live here...)

  7. #7
    Join Date
    Feb 2011
    Location
    Lumberton, TX
    Posts
    557
    Plugin Contributions
    0

    Default Re: Customer Data Corrupted after server error

    well, a couple of SQL scripts could automate the process...just thinking out loud...

  8. #8
    Join Date
    Feb 2005
    Location
    Captain Cook, Hawaii
    Posts
    179
    Plugin Contributions
    0

    Default Re: Customer Data Corrupted after server error

    That is what I did before, manually print the customer pointers, match them manually to the address book entries and created a SQL update file.

    Since this was months ago I think those files are lost and I would have to start over recreating them.

    Since the problem is just be customer related, I wonder if truncating a few sets (orders, customers, etc) might be one way. Otherwise we end up recreating the whole store again.

    I just don't understand all the links and thus have not delved into it.
    Aloha from Hawaii! (its a dirty job, but SOMEBODY has to live here...)

  9. #9
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Customer Data Corrupted after server error

    This could clean it up automatically when they login (assuming they log in directly):

    /includes/modules/pages/login/header_php.php
    Code:
            $messageStack->add('login', TEXT_LOGIN_ERROR);
          } else {
            if (SESSION_RECREATE == 'True') {
              zen_session_recreate();
            }
    
            if ($check_customer->fields['customers_default_address_id'] == 0) {
              $sql = "SELECT address_book_id
                                    FROM " . TABLE_ADDRESS_BOOK . "
                                    WHERE customers_id = :customersID";
              $sql = $db->bindVars($sql, ':customersID', $check_customer->fields['customers_id'], 'integer');
              $test = $db->Execute($sql);
              if ($test->RecordCount() == 1) {
                $sql = "UPDATE " . TABLE_CUSTOMERS . " SET customers_default_address_id = :addressBookID WHERE customers_id = :customersID";
                $sql = $db->bindVars($sql, ':customersID', $test->fields['customers_id'], 'integer');
                $sql = $db->bindVars($sql, ':addressBookID', $test->fields['address_book_id'], 'integer');
                $result = $db->Execute($sql);
                $check_customer->fields['customers_default_address_id'] = $test->fields['address_book_id'];
              } else {
                $messageStack->add_session('header', 'ALERT: There seems to be a problem with your address book entries. Please re-select your primary address before going through checkout.', 'error');
                $address_book_error = TRUE;
                //zen_redirect(zen_href_link(FILENAME_ADDRESS_BOOK, '', $request_type));
              }
            }
            
            $check_country_query = "SELECT entry_country_id, entry_zone_id
    and, same file, about 20 lines later:
    Code:
            $_SESSION['cart']->restore_contents();
            // eof: not require part of contents merge notice
    
    if (isset($address_book_error) && $address_book_error == TRUE) {
      zen_redirect(zen_href_link(FILENAME_ADDRESS_BOOK, '', $request_type));
    }
    .

    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.

  10. #10
    Join Date
    Feb 2005
    Location
    Captain Cook, Hawaii
    Posts
    179
    Plugin Contributions
    0

    Default Re: Customer Data Corrupted after server error

    I'll give that a try. Thanks.
    Aloha from Hawaii! (its a dirty job, but SOMEBODY has to live here...)

 

 

Similar Threads

  1. v139h No show admin data after move server with much newer PHP
    By dmagic in forum General Questions
    Replies: 8
    Last Post: 20 Apr 2013, 12:15 AM
  2. Security error for customer login after host server change
    By sparrowce in forum General Questions
    Replies: 9
    Last Post: 29 Jul 2011, 11:26 AM
  3. Fixing corrupted state data
    By Axcess in forum General Questions
    Replies: 3
    Last Post: 18 Aug 2010, 05:46 PM
  4. Problem after creating fake customer - Internal Server Error
    By dragonimpact in forum General Questions
    Replies: 0
    Last Post: 26 Feb 2008, 02:16 AM

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