Page 1 of 1

Order-info total price

Posted: Thu May 16, 2019 11:59 pm
by rale
Hi there!
On the customer side, order info page, final price indicates with the code

Code: Select all

    
          {% for total in totals %}
          <tr>
            <td colspan="4"></td>
            <td class="text-right"><b>{{ total.title }}</b></td>
            <td class="text-right">{{ total.text }}</td>
            {% if products %}
            <td></td>
            {% endif %} </tr>
          {% endfor %} 
          
And that look like this

Code: Select all

Sub-Total
$80.00 Flat Shipping Rate
$5.00 Total
$85.00
or like this if just use total.text

Code: Select all

$80.00 $5.00 $85.00
how can still show just the final price? It is necessary for order info on customer side?
OC 3.0.2.0
Thank you!

Re: Order-info total price

Posted: Fri May 17, 2019 12:18 am
by MarketInSG
You can try this: https://twig.symfony.com/doc/2.x/filters/last.html

Get the last element in the array, which will be the final total

Re: Order-info total price

Posted: Fri May 17, 2019 12:59 am
by rale
Txanks for answer!
How use that? Not understand.