You are here

function commerce_cart_contents_pane_checkout_form in Commerce Core 7

Checkout pane callback: returns the cart contents View for inclusion in the checkout form.

File

modules/cart/includes/commerce_cart.checkout_pane.inc, line 55
Checkout pane callback functions for the cart module.

Code

function commerce_cart_contents_pane_checkout_form($form, &$form_state, $checkout_pane, $order) {
  $pane_form = array();

  // Extract the View and display keys from the cart contents pane setting.
  list($view_id, $display_id) = explode('|', variable_get('commerce_cart_contents_pane_view', 'commerce_cart_summary|default'));
  $pane_form['cart_contents_view'] = array(
    '#markup' => commerce_embed_view($view_id, $display_id, array(
      $order->order_id,
    )),
  );

  // Attach the Cart and Price module CSS to accommodate the order total area
  // handler's CSS being reloaded properly on a form rebuild.
  $pane_form['cart_contents_views']['#attached']['css'][] = drupal_get_path('module', 'commerce_cart') . '/theme/commerce_cart.theme.css';
  $pane_form['cart_contents_views']['#attached']['css'][] = drupal_get_path('module', 'commerce_price') . '/theme/commerce_price.theme.css';
  return $pane_form;
}