Why are my customers’ address books missing/empty?

With the update to WooCommerce Address Book 3.0, we have updated the data structure of how the addresses are stored in the database. This was done to improve performance, reduce the size of the database queries. In the update, there is an update script that runs to convert your customers’ addresses into the new structure. So all your customers’ addresses are still in the database but there is most likely an issue with the output of this address data.

Why are my customers’ address books missing/empty?

With the update to WooCommerce Address Book 3.0, we have updated the data structure of how the addresses are stored in the database. This was done to improve performance, reduce the size of the database queries. In the update, there is an update script that runs to convert your customers’ addresses into the new structure. So all your customers’ addresses are still in the database but there is most likely an issue with the output of this address data.

Solutions

To resolve the issue we suggest going through the following steps.

1. Review your template overrides

With the 3.0 release, we have revamped the Address Book template and styles, giving it a sleek and modern UX/UI. This change effect the My Accounts > Address book page for logged-in users. Any customization made by your site’s theme or another plugin to the wp-content/plugins/woo-address-book/templates/my-address-book.php should be reviewed and updated.

We suggest following the WooCommerce documentation on Fixing Outdated WooCommerce Templates.

2. Review your Hooks, Actions and Filters

We have updated the Hooks, Actions, and Filters the plugin uses and offers to bring it up to the WooComemrce Marketplace plugins standards. Please review and update any Hooks, Actions, and Filters added or removed by your site’s theme or another plugin.

Please review the WooCommerce Address Book Repository and review the Hooks, Actions and Filters used.

3. Review any calls to the WC_Address_Book

We have optimized many of the functions in the WC_Address_Book class. Any direct calls made by your site’s theme or another plugin will need to be reviewed and updated. Please review the WooCommerce Address Book Repository and Compare Version 2.6.0 to 3.0.1 to see the direct changes made.

4. Review any direct database queries

We have updated the data structure of the address book and how it is stored in the database.

The previous versions of the plugin stored each address’s part on its own database row within the {$wpdb->prefix}usermeta table. This would lead to larger-than-needed user meta storage and inefficient queries when requesting multiple addresses.

An example of this is looking something like

umeta_id user_id meta_key meta_value
100 1 shipping_state AL
101 1 shipping_postcode 35004
102 1 shipping_last_name Smith
103 1 shipping_first_name John
104 1 shipping_country US
105 1 shipping_city Anytown
106 1 shipping_address_nickname
107 1 shipping_address_1 123 Main St

Version 3.0 an upgrade script was created to convert all of the old addresses into the new structure. The new structure consists of a serialized array of an address with all its parts as well as an index array for all the saved addresses.

An example of this is looking something like

umeta_id user_id meta_key meta_value 
108 1 wc_address_book_address_billing_a1 a:12:{s:16:"address_nickname";s:0:"";s:10:"first_n…

And the address book index is stored like

umeta_id user_id meta_key meta_value
109 1 wc_address_book_shipping a:2:{s:9:"addresses";a:51:{i:0;s:2:"a1";i:1;s:2:"a…

Still, having trouble?

Please reach out to us on the WooCommerce Address Book plugin support thread with any other issues you may be experiencing. The more information, like your WooCommerce System Status Report and a screenshot of the error, you can provide the faster and more accurately we can respond.

We appreciate any feedback we receive and by taking the time to do so you help us make a better product and improve the community as a whole.