Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,712
    Plugin Contributions
    123

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

    This is not a bug. You are deliberately screwing up your data. There's no way AFAIK for this to happen organically unless you're attacking your own database.
    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.

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

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

    Quote Originally Posted by jjone View Post
    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
    To put it another way, there is no expectation that every customer would have the same address_book_id. The issue to try to understand is how did they all end up the same?

    So see, if the data was all wrong, then yes the queries against it and other associated code would work unexpectedly. As such there does not actually appear to be a problem with the code in that area unless an operation while using it changes the value for all customers to a single value.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

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

    Hi

    I will re-create the scenario I experienced on a test server using the same data (which I have backup up from live site) and report back.

    I noticed that when this happened there were quite a few logs complaining about htmlspecialcharacters and pointing to classes>customer.php...lines 791,811,830 and 847.

  4. #14
    Join Date
    Jun 2005
    Posts
    309
    Plugin Contributions
    0

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

    Dax - Maybe we should be trying to figure out what we have in common that ate both our databases about the same time. Did you recently switch to square? Did you install lat9's access blocker? Do you host on liquid web? What have you done recently that maybe I did too and am not thinking about?
    2 + 2 = 5 for extremely large values of 2

    Pez Collectors Store

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

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

    Hi Gothstone

    I recently switched to Square. That would appear to be the common denominator.

    Also, before correcting my database I saved the customer and address book tables. Reviewing those there is one entry where the customer ID is missing from the address_book table sequence. That missing ID happened when the database went haywire. They hadn't purchased anything so the Square module wasn't triggered.

    Still at a loss what happened.

  6. #16
    Join Date
    Jun 2009
    Location
    Europe
    Posts
    58
    Plugin Contributions
    1

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

    Quote Originally Posted by DaxtheMan View Post
    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
    Yes, it is a bug.
    In classes/Customers.php around line 354:
    PHP Code:
    protected function setDefaultAddressBookId(int $id)
        {
            global 
    $db;
            
    $sql "UPDATE " TABLE_CUSTOMERS " SET customers_default_address_id=" . (int)$id;
            
    $db->Execute($sql);
            
    $this->data['customers_default_address_id'] = (int)$id;
        } 
    THIS UPDATE STATEMENT CHANGES DEFAULT ADDRESS BOOK ID OF ALL CUSTOMERS, SINCE THERE IS NO WHERE STATEMENT!

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

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

    This is a bug in Zen Cart 1.5.8/1.5.8a which was fixed in Zen Cart 2.0.0.

    Credit to @marco-pm for fixing this!

    https://github.com/zencart/zencart/pull/5687

    And credit to @zamzom for tracking this down - I had long since forgotten this issue.
    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.

 

 
Page 2 of 2 FirstFirst 12

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