fixup display of product and shoppingcart prices

master
Marek Isalski 8 years ago
parent 633676c3fc
commit 4e37364752

@ -1,5 +1,5 @@
<tr>
<td><span class="pull-right"><a class="btn btn-xs btn-danger" title="Remove from cart" href="<?php print fulcrm_shoppingcart_remove_url( $item[ 'id' ] ); ?>"><span class="glyphicon glyphicon-trash"></span></a></span><?php if ( array_key_exists( 'name', $item[ 'd' ] ) ) print nl2br( check_plain( $item[ 'd' ][ 'name' ] ) ); else print check_plain( $item[ 'product' ][ 'name' ] ); ?></td>
<td class="text-right"><?php print check_plain( $item[ 'product' ][ '_price' ][ 'format_total_net' ] ); ?></td>
<td class="text-right"><?php print ( ( array_key_exists( 'format_item_gross', $item[ 'product' ][ '_price' ] ) && $item[ 'product' ][ '_price' ][ 'format_item_gross' ] ) ? check_plain( $item[ 'product' ][ '_price' ][ 'format_item_gross' ] ) : t('free') ); ?></td>
<td class="text-right"><?php print check_plain( $item[ 'quantity' ] ); ?></td>
</tr>

@ -20,11 +20,16 @@
Total
</th>
<th class="text-right">
<?php $any = false; ?>
<?php if ( count( $transaction[ '_price' ][ 'total' ] ) ): ?>
<?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 $currency . ' ' . $price[ 'format_gross' ]; ?></div>
<?php endif; ?>
<?php endforeach; ?>
<?php else: ?>
<?php endif; ?>
<?php if ( !$any ): ?>
<em>free</em>
<?php endif; ?>
</th>

Loading…
Cancel
Save