You are here

function commerce_customer_profile_pane_review in Commerce Core 7

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

File

modules/customer/includes/commerce_customer.checkout_pane.inc, line 315
Checkout pane callback functions for the customer module.

Code

function commerce_customer_profile_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');
  }
}