Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2010
    Posts
    2
    Plugin Contributions
    0

    Default Fixing corrupted state data

    I am working on a previously installed zen cart. The installer has called on me to fix a database issue. I'm not sure how it happened, but the state data for all currently existing users is bogus data. This creates a problem when existing users log in and want to buy something. I need to update about 6000 users' state field in the database.

    My question is this. Is there any way to run a simple script when a user logs in in order to force them to verify their state if the database contains bad information? I think this would fix the problem, however Ive never worked with zen cart before and I am not sure how to cleanly run a script on login. I would appreciate all suggestions, as well as information about looking a script to login.

    Thanks

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Fixing corrupted state data

    This would be rather complex to integrate, and there's nothing out there currently that would help. Both the script you'd need to write and its integration would need to be custom.

    Surely a better approach would be to regain as much of this data as possible from your client's database backups. Exposing this problem to all of his client's should be very much a last resort.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Fixing corrupted state data

    Here's another though. The textual representation of state is grabbed with each order for the customer's, billing and shipping addresses.

    This is a snapshot from the time of order, so should be resistant to the corruption that has occurred. You could map these back to the state codes and reload the state codes to the address book table.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  4. #4
    Join Date
    Aug 2010
    Posts
    2
    Plugin Contributions
    0

    Default Re: Fixing corrupted state data

    It sounds like you're telling me the state data is store twice in the database, once as master for each user, and once for every order they make. I'll look into this. it sounds like I might be able to write an sql maintenance script and run it on the database directly. I'll look into it.

    Thanks

 

 

Similar Threads

  1. v151 Error with the province (state) and the phone number data
    By AlexThibo in forum PayPal Express Checkout support
    Replies: 2
    Last Post: 26 Dec 2013, 02:19 PM
  2. v139h Customer Data Corrupted after server error
    By mshultise in forum General Questions
    Replies: 9
    Last Post: 25 Jun 2013, 09:51 PM
  3. State dropdown not showing when entered state wrong
    By xavierpages in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 15 May 2011, 11:17 AM
  4. Charge state tax even when you're out of state
    By csmith in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 15
    Last Post: 20 Apr 2009, 06:39 AM
  5. State Dropdown Menu - Data is where?
    By Peace Freak in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 4 Oct 2006, 10:40 AM

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