You are here

function commerce_invoice_receipt_view_print in Commerce Invoice Receipt 7

Same name and namespace in other branches
  1. 7.2 commerce_invoice_receipt.module \commerce_invoice_receipt_view_print()
1 string reference to 'commerce_invoice_receipt_view_print'
commerce_invoice_receipt_menu in ./commerce_invoice_receipt.module
Implements hook_menu().

File

./commerce_invoice_receipt.module, line 128
Provides a printable invoice receipt along with HTML mailing rules.

Code

function commerce_invoice_receipt_view_print($order, $view_mode = 'invoice', $breadcrumb = TRUE) {
  $styles[] = array(
    'type' => 'file',
    'media' => 'all',
    'data' => commerce_invoice_receipt_css_path(),
    'group' => CSS_DEFAULT,
    'every_page' => FALSE,
    'weight' => 0,
    'preprocess' => FALSE,
    'browsers' => array(),
  );
  $html = drupal_get_css($styles);
  if (module_exists('views_ui')) {
    views_ui_contextual_links_suppress(TRUE);
  }
  $build = entity_view('commerce_order', array(
    $order->order_id => $order,
  ), $view_mode, NULL, TRUE);
  $invoice_info = _commerce_invoice_receipt_get_invoice_info($order, $build);
  $html .= theme('commerce_order_invoice_view', array(
    'info' => $invoice_info,
    'order' => $order,
  ));
  print _emogrifier_process($html, NULL, NULL, NULL, NULL, NULL);
}