Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Jun 2023
    Location
    UK
    Posts
    13
    Plugin Contributions
    0

    Default Customer address not appearing in admin>customers - all of a sudden!

    Hi

    Can anyone help please?

    Running 1.5.8a with PHP8.2

    All of a sudden I have a weird problem. Started 7th Dec but site working just fine before that!

    In admin>customers (index.php?cmd=customers) the customers list correctly. However, when Edit is pressed the page loads perfectly except for the customer's address. Refresh that page and the address loads.

    Meanwhile, in the logs, this error is repeated:

    [13-Dec-2023 15:27:13 Europe/London] Request URI: /admin/index.php?cmd=customers&page=1, IP address: 51.185.139.30, Language id 1
    #0 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/includes/classes/Customer.php(282): zen_debug_error_handler()
    #1 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/includes/classes/Customer.php(29): Customer->load()
    #2 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/admin/customers.php(1622): Customer->__construct()
    #3 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/admin/index.php(11): require('...')
    --> PHP Warning: Undefined array key "address_book_id" in /var/www/vhosts/xxxxxxxco.uk/httpdocs/includes/classes/Customer.php on line 282.

    [13-Dec-2023 15:27:13 Europe/London] Request URI: /admin/index.php?cmd=customers&page=1, IP address: 51.185.139.30, Language id 1
    #0 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/includes/classes/Customer.php(282): zen_debug_error_handler()
    #1 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/includes/classes/Customer.php(29): Customer->load()
    #2 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/admin/customers.php(1622): Customer->__construct()
    #3 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/admin/index.php(11): require('...')
    --> PHP Warning: Undefined array key "zone_id" in /var/www/vhosts/xxxxxx.co.uk/httpdocs/includes/classes/Customer.php on line 282.

    [13-Dec-2023 15:27:13 Europe/London] Request URI: /admin/index.php?cmd=customers&page=1, IP address: 51.185.139.30, Language id 1
    #0 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/includes/classes/Customer.php(282): zen_debug_error_handler()
    #1 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/includes/classes/Customer.php(29): Customer->load()
    #2 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/admin/customers.php(1622): Customer->__construct()
    #3 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/admin/index.php(11): require('...')
    --> PHP Warning: Undefined array key "country_id" in /var/www/vhosts/xxxxxxx.co.uk/httpdocs/includes/classes/Customer.php on line 282.

    [13-Dec-2023 15:27:13 Europe/London] Request URI: /admin/index.php?cmd=customers&page=1, IP address: 51.185.139.30, Language id 1
    #0 /var/www/vhosts/xxxxxxco.uk/httpdocs/admin/customers.php(1668): zen_debug_error_handler()
    #1 /var/www/vhosts/xxxxxxx.co.uk/httpdocs/admin/index.php(11): require('...')
    --> PHP Warning: Undefined array key "company" in /var/www/vhosts/xxxxxx.co.uk/httpdocs/admin/customers.php on line 1668.
    includes/classes/Customer.php is unaltered from virgin 1.5.8a version.

    I am at a loss where to search to see what is triggering this response. There doesn't appear to be any activity in the database on the 6-7th Dec to have caused this change and no site alterations were made (actually on vacation at the time)...

    Would appreciate any pointers to solve this one!

  2. #2
    Join Date
    Jun 2023
    Location
    UK
    Posts
    13
    Plugin Contributions
    0

    Default Re: Customer address not appearing in admin>customers - all of a sudden!

    Me Again!

    Okay, so I have noticed something that may be the cause. In the table 'Customers' the 'customers_default_address_id' column has the same for every customer!

    I feel that the number there should match the address_book_ id in the address_book table but doesn't.

    Can anyone confirm that the assumption above is correct?

    If so, can anyone suggest a way to re-connect the two tables so they tally?

    Thanks

    Dax

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,708
    Plugin Contributions
    123

    Default Re: Customer address not appearing in admin>customers - all of a sudden!

    Write a script that for each record in the customers table, finds a record in the address book table (with address_book_id >= customers_id) where customers_firstname = entry_firstname and customers_lastname = entry_lastname. This will hopefully fix most of them.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Jun 2023
    Location
    UK
    Posts
    13
    Plugin Contributions
    0

    Default Re: Customer address not appearing in admin>customers - all of a sudden!

    Thanks SWGUY

    So I'm thinking:

    INSERT INTO customers (customers_default_address_id)
    SELECT address_book_id
    FROM address_book
    WHERE customers_id = customers_id and
    customers_firstname = entry_firstname and
    customers_lastname = entry_lastname

    Since there are 20000 names I don't want to mess this up!

    Can anyone confirm the above or suggest better script?

    Thanks

  5. #5
    Join Date
    Jun 2023
    Location
    UK
    Posts
    13
    Plugin Contributions
    0

    Default Re: Customer address not appearing in admin>customers - all of a sudden!

    This is the SQL I finally used.

    UPDATE customers INNER JOIN address_book ON customers.customers_id = address_book.customers_id SET customers.customers_default_address_id = address_book.address_book_id
    WHERE customers.customers_firstname = address_book.entry_firstname and customers.customers_lastname = address_book.entry_lastname

    Hopefully that will be an end to it!

  6. #6
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: Customer address not appearing in admin>customers - all of a sudden!

    Well perhaps for existing customers, but what about new ones? Further, figured out why the above was necessary?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,708
    Plugin Contributions
    123

    Default Re: Customer address not appearing in admin>customers - all of a sudden!

    Good point - it would be worth creating a new (test) storefront account and being sure the customers_default_address_id is set correctly.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  8. #8
    Join Date
    Jun 2005
    Posts
    309
    Plugin Contributions
    0

    Default Re: Customer address not appearing in admin>customers - all of a sudden!

    following, I suddenly have the same issue and no clue why
    2 + 2 = 5 for extremely large values of 2

    Pez Collectors Store

  9. #9
    Join Date
    Jun 2005
    Posts
    309
    Plugin Contributions
    0

    Default Re: Customer address not appearing in admin>customers - all of a sudden!

    For my site the issue happened sometime between Nov 26th and Dec 13th. The last real change I made was switching from PayPal Pro to the paid version of the Square module, but it can't have been the installation of Square because I did that to my dev site first, and my dev site didn't have the messed up default addresses. I also installed lat's access blocker, but that shouldn't come close to touching the addresses...
    just trying to throw out info here in hopes someone figures this out.
    2 + 2 = 5 for extremely large values of 2

    Pez Collectors Store

  10. #10
    Join Date
    Oct 2008
    Posts
    10
    Plugin Contributions
    1

    Default Re: Customer address not appearing in admin>customers - all of a sudden!

    This is a zen cart 1.5.8a bug
    ------------------------------------
    This is how to test it: first change all customer default address id to a same number with following sql.

    UPDATE customers set customers_default_address_id = 10

    -------------------------------------------------------------------------------------
    Now, login to your zen cart admin and goto Customers and click on any customer

    after that, open phpMyAdmin and refresh the customers tables

    all rows of customers_default_address_id are set to a same wrong address id.

    something is wrong with the customers.php, customers_default_address_id should only update only 1 customer.

    Thank you

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Admin Log In Not Working, User Log In Not Working All of a Sudden
    By SpydSpyder in forum General Questions
    Replies: 7
    Last Post: 15 Oct 2012, 05:34 AM
  2. Customer Address Not Showing Up in Admin
    By machinerye in forum Managing Customers and Orders
    Replies: 1
    Last Post: 16 Aug 2011, 11:41 AM
  3. Paypal orders not showing up in admin all of a sudden
    By thebeveragegourmet in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 28 Mar 2009, 03:11 PM
  4. Strange Shipping Address appearing in Customer Accounts
    By Mike_Dean in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 3 Jan 2008, 12:08 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