Display the method of payment of an order on the invoice pdf comerce billy I installed Commerce Billy. 

How can I display the payment method on my bill?

&lt;?php

/**
 * @file
 * Template for invoiced orders.
 */

?&gt;
&lt;?php
//The code to get payment type

$order_id = $content['commerce_customer_billing']['#object']-&gt;order_id;

$payment_method = '';
$order = commerce_order_load($order_id);
$r = explode('|', $order-&gt;data['payment_method']);

if (count($r) &gt; 1){
  $rule = rules_config_load($r[1]);
  $payment_method = $rule-&gt;label;
}
?&gt;
&lt;div class="invoice-invoiced"&gt;
  &lt;div class="header"&gt;
    &lt;img src="&lt;?php print $content['invoice_logo']['#value']; ?&gt;"/&gt;
    &lt;div class="invoice-header"&gt;
        &lt;p&gt;&lt;?php print render($content['invoice_header']); ?&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;hr/&gt;

  &lt;div class="customer-billing"&gt;&lt;?php print render($content['commerce_customer_billing']); ?&gt;&lt;/div&gt;
  &lt;div class="customer-shipping"&gt;&lt;?php print render($content['commerce_customer_shipping']); ?&gt;&lt;/div&gt;
  &lt;h1 class="credit-memo"&gt;&lt;?php print render($content['invoice_title']); ?&gt;&lt;/h1&gt;
  &lt;div class="invoice-header-date"&gt;&lt;?php print render($content['invoice_header_date']); ?&gt;&lt;/div&gt;
  &lt;div class="order-id"&gt;&lt;?php print render($content['order_id']); ?&gt;&lt;/div&gt;


  &lt;?php print($payment_method); // Use this PHP Code where you want to print the payment type, you can style it any way, adding div, span, whatever you want ?&gt;     


  &lt;div class="line-items"&gt;
    &lt;div class="line-items-view"&gt;&lt;?php print render($content['commerce_line_items']); ?&gt;&lt;/div&gt;
    &lt;div class="order-total"&gt;&lt;?php print render($content['commerce_order_total']); ?&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="invoice-text"&gt;&lt;?php print render($content['invoice_text']); ?&gt;&lt;/div&gt;

  &lt;div class="invoice-footer"&gt;&lt;?php print render($content['invoice_footer']); ?&gt;&lt;/div&gt;
&lt;/div&gt;


Here are the contents of my file "commerce_order--commerce_order--pdf.tpl.php".
Where do I put the code ?
You can use code below to get the payment method of an order by passing order id to the function. The order id on Commerce billy template file can be easily found in this variable $content['commerce_customer_billing']['#object']->order_id and some other variables as well:

$order_id = $content['commerce_customer_billing']['#object']-&gt;order_id;

$payment_method = '';
$order = commerce_order_load($order_id);
$r = explode('|', $order-&gt;data['payment_method']);

if (count($r) &gt; 1){
  $rule = rules_config_load($r[1]);
  $payment_method = $rule-&gt;label;
}


After using this function, you can print the payment method on your bill by printing $payment_method variable.