Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: zen_address_label returns old address after address change

    Yesterday I tried to run through something similar, but I'm unsure of what is needed to reproduce the observed problem as relates to a default install.

    I logged into the catalog side account.
    I went to the account area where I went to modify the address information.
    I updated two different addresses while I was there, one was a non-primary address. When I selected to update it, the new "list" of addresses was correct showing the new address (a change in just the street name).
    I then repeated the effort for the default address to use a different change.
    When looking at the list of address information, everything was as it now should be.

    But, I have a feeling that I didn't follow the same process to recreate the issue. Was this something done during checkout or some other process?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #12
    Join Date
    Jun 2012
    Posts
    412
    Plugin Contributions
    0

    Default Re: zen_address_label returns old address after address change

    The use case I was working on is to send an email to someone who is managing a different database in Access when a customer changes their address. The data in the store and Access database includes name and address of members of our organization. When a member of the organization changes their address, either by editing the default primary address, or by selecting a different address in the address book as the default (primary) address, or if the store admin changes a members primary address who notifies us, I want to send the email with old and new addresses so the manager of the Access database can sync to the store's database. He sends me changes to the Access database periodically that I need to enter.

    To send the email, I set up two observers, one notified before the address is changed at the start of address book header processing. The other observer is notified later after the address is changed in the header in two places, and I just added a custom notifier in admin/customers.php, again after customer's address was changed.

    To format the name and address in the address change notification email, I used zen_address_label. This repeatedly returned the old address until I added NoCache to the Execute in function/functions_customers as described above. The correct address was returned immediately after I made the change. For each test the display on the address book was correct as mc12345678 discovered in his/her test. For each test, I logged out and back in, but I did not quit the browser (Firefox), or try another browser. SQL_CACHE_METHOD is set to the default (none). Since I made the change, the observers are working perfectly, thanks to lat9, mc12345678, and DrByte.

    I plan to write up how I got the admin notifier to notifier an observer on the store side for swguy. I do not feel confident enough to submit a pull request in GIT.

    Again, thank you all for all your help, not only now, but over the years. I sent coffee to you all a few days ago.
    Last edited by Dave224; 12 Sep 2020 at 10:27 PM.

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

    Default Re: zen_address_label returns old address after address change

    Quote Originally Posted by Dave224 View Post

    To format the name and address in the address change notification email, I used zen_address_label. This repeatedly returned the old address until I added NoCache to the Execute in function/functions_customers as described above.
    To be very clear, you mean: until you changed

    $address = $db->Execute($address_query);

    to:

    $address = $db->ExecuteNoCache($address_query);

    (saying "added NoCache" could make people think you changed the parameters to Execute. If you read post #3, you'll see how someone could easily become confused.)

    Can you check your copy of includes/classes/db/mysql/query_factory.php against a fresh download of 1.5.7 to make sure it hasn't been altered?
    Last edited by swguy; 12 Sep 2020 at 11:18 PM.
    That Software Guy. My Store: Zen Cart Modifications
    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. #14
    Join Date
    Jun 2012
    Posts
    412
    Plugin Contributions
    0

    Default Re: zen_address_label returns old address after address change

    swguy,

    Yes you are correct. Change $address = $db->Execute($address_query); to $address = $db->ExecuteNoCache($address_query); in line 132 in v155f, line 137 in v156c, and in line 138 in v157.

    No changes have been made to includes/classes/db/mysql/query_factory.php. My test version of this file is identical to the base v155f. I do not have v157 running yet, but no changes should be made by me.
    Dave

  5. #15
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,684
    Plugin Contributions
    123

    Default Re: zen_address_label returns old address after address change

    Thanks for confirming.

    Thanks too for you anticipated contribution to the system documentation.
    That Software Guy. My Store: Zen Cart Modifications
    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. Replies: 9
    Last Post: 7 May 2016, 06:39 PM
  2. Replies: 6
    Last Post: 8 Mar 2012, 06:36 PM
  3. Change Email Address on old customer order
    By ricangem in forum Managing Customers and Orders
    Replies: 3
    Last Post: 17 Oct 2011, 04:26 AM
  4. Forwarding to Select shipping address after logging in or creating new address
    By bindaaz in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 28 Jan 2011, 12:54 PM
  5. Blank Page after clicking change address
    By Kinjal in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 3 Jun 2008, 09:43 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