Blogs

EMAIL: info@example.com

Centarro: Understanding the Drupal Commerce 2.x Address Book

Drupal Commerce 2.x includes address book functionality for both customers (from their account pages and checkout form) and administrators (from order edit pages). This article provides a quick summary of the address book architecture to help you understand how customer addresses are modeled / saved to your database and what you need to take into consideration when writing custom code / data migration processes for orders and customer profiles.

Commerce Core uses our Address module to add address fields to various entities, including stores and customer profiles. Address fields are not added directly to orders, payment methods, or shipments – the things for which we might typically expect an address to be selected from an address book. Those entities instead reference profiles with addresses that represent billing and shipping addresses.

As a result, a user’s address book is basically just a collection of profiles with the same uid as the user. These profiles are created in various ways:
Read more


Go to Source
Author: