diff --git a/modules/order/src/Element/ProfileSelect.php b/modules/order/src/Element/ProfileSelect.php
index 3b09fb1..35f40bf 100644
--- a/modules/order/src/Element/ProfileSelect.php
+++ b/modules/order/src/Element/ProfileSelect.php
@@ -3,9 +3,13 @@
 namespace Drupal\commerce_order\Element;
 
 use Drupal\commerce\Element\CommerceElementBase;
+use Drupal\Component\Utility\Html;
+use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Entity\Entity\EntityFormDisplay;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\profile\Entity\ProfileInterface;
+use Drupal\profile\Entity\Profile;
+use Symfony\Component\HttpFoundation\Request;
 
 /**
  * Provides a form element for selecting a customer profile.
@@ -44,6 +48,9 @@ class ProfileSelect extends CommerceElementBase {
         [$class, 'attachElementSubmit'],
         [$class, 'processForm'],
       ],
+      '#after_build' => [
+        [$class, 'afterBuild'],
+      ],
       '#element_validate' => [
         [$class, 'validateElementSubmit'],
         [$class, 'validateForm'],
@@ -83,7 +90,84 @@ class ProfileSelect extends CommerceElementBase {
       throw new \InvalidArgumentException('The commerce_profile_select #available_countries property must be an array.');
     }
 
+    //Initialize variables.
     $element['#profile'] = $element['#default_value'];
+    $pane_id = $element['#name'];
+    $mode = 'view';
+    $profile_selection_parents = $element['#parents'];
+    $profile_selection_parents[] = 'profile_selection';
+
+    $profile_id = $form_state->getValue($profile_selection_parents);
+    $default_profile_id = NULL;
+    $storage = $form_state->getStorage();
+    $bundle = $element['#profile']->bundle();
+    // User is adding a new profile.
+    if ($profile_id && $profile_id == 'new_address') {
+      $mode = 'new';
+      unset($storage['pane_' . $pane_id]);
+    }
+    // If an AJAX rebuild happened, we might have our data in form state.
+    elseif (!empty($storage['pane_' . $pane_id])) {
+      $default_profile = $storage['pane_' . $pane_id]['profile'];
+      $default_profile_id = $default_profile->id();
+      $mode = $storage['pane_' . $pane_id]['mode'];
+      $bundle = $default_profile->bundle();
+    }
+    // Loading the page for the first time.
+    elseif ($element['#profile']->id()) {
+      $default_profile = $element['#profile'];
+      $default_profile_id = $default_profile->id();
+      $bundle = $default_profile->bundle();
+    }
+
+    $ajax_wrapper_id = Html::getUniqueId('profile-select-ajax-wrapper');
+    // Prefix and suffix used for Ajax replacement.
+    $element['#prefix'] = '<div id="' . $ajax_wrapper_id . '">';
+    $element['#suffix'] = '</div>';
+
+    // Fetch all profiles of the user for an addressbook functionality.
+    $profile_uid = $element['#profile']->getOwnerId();
+    // Anonymous users don't get an addressbook.
+    if ($profile_uid) {
+      $profile_ids = \Drupal::service('entity.query')
+        ->get('profile')
+        ->condition('uid', $profile_uid)
+        ->condition('type', $bundle)
+        ->condition('status', TRUE)
+        ->sort('profile_id', 'DESC')
+        ->execute();
+      $profiles = Profile::loadMultiple($profile_ids);
+      $profile_options = [];
+      /** @var \Drupal\profile\Entity\Profile $profile_option */
+      foreach ($profiles as $profile_option) {
+        if (empty($default_profile_id)) {
+          $default_profile_id = $profile_option->id();
+          $default_profile = $profile_option;
+        }
+        $profile_options[$profile_option->id()] = $profile_option->label();
+      }
+      $profile_options['new_address'] = t('+ Enter a new address');
+    }
+
+    // Remember the current profile and mode in form state.
+    if (!empty($default_profile)) {
+      $storage['pane_' . $pane_id] = [
+        'profile' => $default_profile,
+        'mode' => $mode
+      ];
+      $form_state->setStorage($storage);
+      $element['#profile'] = $default_profile;
+    }
+    // No profiles found or user wants to create a new one.
+    elseif (empty($profiles) || $mode == 'new') {
+      $values = [
+        'type' => $element['#profile']->bundle(),
+        'uid' => $element['#profile']->getOwnerId()
+      ];
+      $default_profile = Profile::create($values);
+      $mode = 'new';
+    }
+
     $form_display = EntityFormDisplay::collectRenderDisplay($element['#profile'], 'default');
     $form_display->buildForm($element['#profile'], $element, $form_state);
     if (!empty($element['address']['widget'][0])) {
@@ -100,6 +184,85 @@ class ProfileSelect extends CommerceElementBase {
       }
     }
 
+    $called_class = get_called_class();
+    if (!empty($profile_uid) && $mode != 'edit' && !empty($profile_options)) {
+      $element['profile_selection'] = [
+        '#title' => t('Select an address'),
+        '#options' => $profile_options,
+        '#type' => 'select',
+        '#weight' => -5,
+        '#default_value' => $default_profile_id,
+        '#ajax' => [
+          'callback' => [$called_class, 'profileSelectAjax'],
+          'wrapper' => $ajax_wrapper_id,
+        ],
+        '#element_validate' => [[$called_class, 'profileSelectValidate']],
+      ];
+    }
+
+    // Viewing a profile.
+    if ($mode == 'view') {
+      $view_builder = \Drupal::entityTypeManager()
+        ->getViewBuilder('profile');
+      $content = $view_builder->view($default_profile, 'default');
+
+      $element['rendered_profile'] = [
+        $content,
+      ];
+      $element['edit_button'] = [
+        '#type' => 'button',
+        '#name' => 'pane-' . $pane_id . '-edit',
+        '#value' => t('Edit'),
+        '#limit_validation_errors' => [],
+        '#ajax' => [
+          'callback' => [$called_class, 'profileSelectAjax'],
+          'wrapper' => $ajax_wrapper_id,
+        ],
+        '#element_validate' => [[$called_class, 'profileEditCancelValidate']],
+      ];
+      $element['address']['#access'] = FALSE;
+    }
+    // Add the field widgets for an existing profile.
+    elseif (!empty($profiles) && $mode == 'edit') {
+      $element['cancel_button'] = [
+        '#type' => 'button',
+        '#name' => 'pane-' . $pane_id . '-cancel',
+        '#value' => t('Return to address selection'),
+        '#limit_validation_errors' => [],
+        '#ajax' => [
+          'callback' => [$called_class, 'profileSelectAjax'],
+          'wrapper' => $ajax_wrapper_id,
+        ],
+        '#element_validate' => [[$called_class, 'profileEditCancelValidate']],
+      ];
+    }
+
+    return $element;
+  }
+
+  /**
+   * Element after_build callback.
+   *
+   * @param array $element
+   *   The form element being processed.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
+   *
+   * @return array
+   *   The built form element.
+   */
+  public static function afterBuild(array $element, FormStateInterface $form_state) {
+    $triggering_element = $form_state->getTriggeringElement();
+    if ($triggering_element) {
+      $parents = $triggering_element['#parents'];
+      $last_parent = array_pop($parents);
+      if ($last_parent == 'edit_button') {
+        $element['address']['#access'] = TRUE;
+        $element['edit_button']['#access'] = FALSE;
+        $element['rendered_profile']['#access'] = FALSE;
+        $element['profile_selection']['#access'] = FALSE;
+      }
+    }
     return $element;
   }
 
@@ -116,9 +279,13 @@ class ProfileSelect extends CommerceElementBase {
    *   form, as a protection against buggy behavior.
    */
   public static function validateForm(array &$element, FormStateInterface $form_state) {
-    $form_display = EntityFormDisplay::collectRenderDisplay($element['#profile'], 'default');
-    $form_display->extractFormValues($element['#profile'], $element, $form_state);
-    $form_display->validateFormValues($element['#profile'], $element, $form_state);
+    $parents = $form_state->getTriggeringElement()['#parents'];
+    $triggering_last_parent = array_pop($parents);
+    if (!in_array($triggering_last_parent, ['edit_button', 'cancel_button'])) {
+      $form_display = EntityFormDisplay::collectRenderDisplay($element['#profile'], 'default');
+      $form_display->extractFormValues($element['#profile'], $element, $form_state);
+      $form_display->validateFormValues($element['#profile'], $element, $form_state);
+    }
   }
 
   /**
@@ -130,9 +297,101 @@ class ProfileSelect extends CommerceElementBase {
    *   The current state of the form.
    */
   public static function submitForm(array &$element, FormStateInterface $form_state) {
-    $form_display = EntityFormDisplay::collectRenderDisplay($element['#profile'], 'default');
-    $form_display->extractFormValues($element['#profile'], $element, $form_state);
-    $element['#profile']->save();
+    $pane_id = $element['#name'];
+    $storage = $form_state->getStorage();
+    if (in_array($storage['pane_' . $pane_id]['mode'], ['new', 'edit'])) {
+      $form_display = EntityFormDisplay::collectRenderDisplay($element['#profile'], 'default');
+      $form_display->extractFormValues($element['#profile'], $element, $form_state);
+      $element['#profile']->save();
+    }
+  }
+
+  /**
+   * Profile form AJAX callback.
+   *
+   * @param array $form
+   *   The complete form array.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
+   * @param \Symfony\Component\HttpFoundation\Request $request
+   *   The Request object.
+   *
+   * @return array
+   *   The form element replace the wrapper with.
+   */
+  public static function profileSelectAjax(array &$form, FormStateInterface $form_state, Request $request) {
+    $triggering_element = $form_state->getTriggeringElement();
+    $array_parents = $triggering_element['#array_parents'];
+    array_pop($array_parents);
+    return NestedArray::getValue($form, $array_parents);
+  }
+
+  /**
+   * The #element_validate callback for the profiles dropdown select.
+   *
+   * @param array $element
+   *   The form element.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
+   */
+  public static function profileSelectValidate(array $element, FormStateInterface $form_state) {
+    $triggering_element = $form_state->getTriggeringElement();
+    if (in_array('profile_selection', $triggering_element['#array_parents']) && $triggering_element['#id'] == $element['#id']) {
+      $form = $form_state->getCompleteForm();
+      $profile_element_parents = $element['#parents'];
+      array_pop($profile_element_parents);
+      $profile_element = NestedArray::getValue($form, $profile_element_parents);
+      $pane_id = $profile_element['#name'];
+      $storage = $form_state->getStorage();
+
+      // If the user wants to enter a new address.
+      if ($element['#value'] == 'new_address') {
+        $storage['pane_' . $pane_id]['mode'] = 'new';
+        $values = [
+          'type' => $profile_element['#profile']->bundle(),
+          'uid' => $profile_element['#profile']->getOwnerId(),
+        ];
+        $profile = Profile::create($values);
+        $storage['pane_' . $pane_id]['profile'] = $profile;
+      }
+      else {
+        $storage['pane_' . $pane_id]['mode'] = 'view';
+        $profile_id = $form_state->getValue($element['#parents']);
+        $storage['pane_' . $pane_id]['profile'] = Profile::load($profile_id);
+      }
+      $form_state->setStorage($storage);
+    }
+  }
+
+  /**
+   * The #element_validate callback for the edit and cancel buttons.
+   *
+   * @param array $element
+   *   The form element.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
+   */
+  public static function profileEditCancelValidate(array &$element, FormStateInterface $form_state) {
+    $triggering_element = $form_state->getTriggeringElement();
+    if ($triggering_element && $triggering_element['#id'] === $element['#id']) {
+      $array_parents = $triggering_element['#array_parents'];
+      $last_parent = array_pop($array_parents);
+      if (in_array($last_parent, ['edit_button', 'cancel_button'])) {
+        $complete_form = $form_state->getCompleteForm();
+        $parents = $element['#parents'];
+        array_pop($parents);
+        $element = NestedArray::getValue($complete_form, $parents);
+        $pane_id = $element['#name'];
+        $storage = $form_state->getStorage();
+        if ($last_parent == 'edit_button') {
+          $storage['pane_' . $pane_id]['mode'] = 'edit';
+        }
+        else {
+          unset($storage['pane_' . $pane_id]);
+        }
+        $form_state->setStorage($storage);
+      }
+    }
   }
 
 }
