show "free" if no price to be paid

This commit is contained in:
Marek Isalski 2018-05-14 15:15:33 +01:00
parent e1cbaf7e54
commit e750c7862b

View File

@ -22,11 +22,16 @@
Total Total
</th> </th>
<th class="text-right"> <th class="text-right">
<?php $any = false; ?>
<?php if ( count( $transaction[ '_price' ][ 'total' ] ) ): ?> <?php if ( count( $transaction[ '_price' ][ 'total' ] ) ): ?>
<?php foreach ( $transaction[ '_price' ][ 'total' ] as $currency => $price ): ?> <?php foreach ( $transaction[ '_price' ][ 'total' ] as $currency => $price ): ?>
<div><?php print $price[ 'format_total' ]; ?></div> <?php if ( $price[ 'gross' ] ): ?>
<?php $any = true; ?>
<div><?php print $price[ 'format_gross' ]; ?></div>
<?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php else: ?> <?php endif; ?>
<?php if ( !$any ): ?>
<em>free</em> <em>free</em>
<?php endif; ?> <?php endif; ?>
</th> </th>