You are here

function commerce_addressbook_pane_review in Commerce Addressbook 7.3

Checkout pane callback: returns the cart contents review data for the Review checkout pane.

Copied verbatim from commerce_customer_profile_pane_review.

File

./commerce_addressbook.checkout_pane.inc, line 578
Based on commerce/modules/customer/commerce_customer.checkout_pane.inc

Code

function commerce_addressbook_pane_review($form, $form_state, $checkout_pane, $order) {

  // Load the profile based on the related customer profile reference field...
  if ($field_name = variable_get('commerce_' . $checkout_pane['pane_id'] . '_field', '')) {
    $profile = entity_metadata_wrapper('commerce_order', $order)->{$field_name}
      ->value();
  }
  else {

    // Or use the association stored in the order's data array if no field is set.
    $profile = commerce_customer_profile_load($order->data['profiles'][$checkout_pane['pane_id']]);
  }
  if ($profile) {
    $content = entity_view('commerce_customer_profile', array(
      $profile->profile_id => $profile,
    ), 'customer');
    return drupal_render($content);
  }
  else {
    return t('No information');
  }
}