title: How to commission in twig?
body: <p>I have function to payments </p>
  
  <pre><code>public function calculateClientCost(Transaction $transaction)
  {
      if ($transaction-&gt;getPaymentType() == Order::PAYMENT_TYPE_ALTERNATIVE) {
          return $this-&gt;container-&gt;getParameter('commission_alternative_price');
      }
  
      if ($transaction-&gt;getPaymentType() == Order::PAYMENT_TYPE_PRICE) {
          return $transaction-&gt;getPrice();
      }
  }
  
  
  
  public function calculateCommission(Transaction $transaction)
  {
      if ($transaction-&gt;getPaymentType() == Order::PAYMENT_TYPE_ALTERNATIVE) {
          return $this-&gt;container-&gt;getParameter('commission_alternative_price');
      }
  
      if ($transaction-&gt;getPaymentType() == Order::PAYMENT_TYPE_PRICE) {
          return round($this-&gt;container-&gt;getParameter('commission_publisher') * $transaction-&gt;getPrice() / 100, 2);
      }
  }
  </code></pre>
  
  <p>and there is a problem i want to use the function in my twig. My twig looks like </p>
  
  <pre><code>&lt;span class="rab_mobile"&gt;{{ 'table.head.net_price'|trans }}:&lt;/span&gt;
  {% if t.isNormalPrice() %}
      {{ t.price|localizedcurrency(currency) }}
  {% else %}
      &lt;em&gt;{{ t.alternativePayment|slice(0,15) }}&lt;/em&gt;
  {% endif %}
  </code></pre>
  
  <p>I want to add commission in twig.
  Can anyone suggest me how I can do this?
  Thanks in Advance.</p>