You are here

function commerce_invoice_receipt_view_print in Commerce Invoice Receipt 7.2

Same name and namespace in other branches
  1. 7 commerce_invoice_receipt.module \commerce_invoice_receipt_view_print()

Menu callback, render invoice.

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 117
Provides a printable invoice receipt along with HTML mailing rules.

Code

function commerce_invoice_receipt_view_print($order, $view_mode = 'invoice', $breadcrumb = 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);

  // Theme order invoice.
  $html = theme('commerce_invoice_receipt', array(
    'info' => $invoice_info,
    'order' => $order,
  ));

  // Print formatted output.
  print _commerce_invoice_receipt_prepare_output($html);
}