fulcrm_shoppingcart/fulcrm_shoppingcart_transaction_complete.tpl.php

94 lines
3.7 KiB
PHP
Raw Normal View History

2016-04-08 15:38:57 +01:00
<div class="col col-xs-12 col-sm-12 col-md-8 col-lg-8">
<?php if ( $transaction[ 'failed' ] ): ?>
<div class="alert alert-danger" role="alert">This transaction <strong>failed</strong> on
<?php
$tz = new DateTimeZone('UTC');
$failed = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['failed'],$timezone=$tz);
if ( $failed )
print $failed->format( 'j/M/Y \@ g:ia' );
?></div>
<?php endif; ?>
<?php if ( $transaction[ 'cancelled' ] ): ?>
<div class="alert alert-warning" role="alert">This transaction was <strong>cancelled</strong> on
<?php
$tz = new DateTimeZone('UTC');
$cancelled = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['cancelled'],$timezone=$tz);
if ( $cancelled )
print $cancelled->format( 'j/M/Y \@ g:ia' );
?>.</div>
<?php endif; ?>
<table class="table">
2016-04-08 15:38:57 +01:00
<caption><?php print check_plain( $transaction[ 'name' ] ); ?></caption>
<thead>
<tr>
<th>Item</th>
<th>Price</th>
<th>Quantity</th>
<th>Total</th>
</tr>
</thead>
2016-04-08 11:04:28 +01:00
<tbody>
<?php if ( array_key_exists( 'lineitems', $transaction ) ) { print theme( 'fulcrm_shoppingcart_transaction_items', array( 'items' => $transaction[ 'lineitems' ] ) ); } ?>
</tbody>
<tfoot>
<tr>
<th colspan="3">
Total
</th>
2016-04-07 17:09:54 +01:00
<th class="text-right">
2018-05-14 15:15:33 +01:00
<?php $any = false; ?>
2016-04-07 17:09:54 +01:00
<?php if ( count( $transaction[ '_price' ][ 'total' ] ) ): ?>
<?php foreach ( $transaction[ '_price' ][ 'total' ] as $currency => $price ): ?>
2018-05-14 15:15:33 +01:00
<?php if ( $price[ 'gross' ] ): ?>
<?php $any = true; ?>
<div><?php print $price[ 'format_gross' ]; ?></div>
<?php endif; ?>
2016-04-07 17:09:54 +01:00
<?php endforeach; ?>
2018-05-14 15:15:33 +01:00
<?php endif; ?>
<?php if ( !$any ): ?>
2016-04-07 17:09:54 +01:00
<em>free</em>
<?php endif; ?>
</th>
</tr>
</tfoot>
</table>
2016-04-08 15:38:57 +01:00
</div>
<div class="col col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="panel panel-info">
<div class="panel-heading"><h3 class="panel-title">Information</h3></div>
<div class="panel-body">
<p><strong>Ordered:</strong> <?php
$tz = new DateTimeZone('UTC');
$created = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['created'],$timezone=$tz);
if ( $created )
print $created->format( 'j/M/Y \@ g:ia' );
2016-04-17 13:14:33 +01:00
else
print '<em>pending</em>';
2016-04-08 15:38:57 +01:00
?></p>
<p><strong>Completed:</strong> <?php
$tz = new DateTimeZone('UTC');
$completed = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['completed'],$timezone=$tz);
if ( $completed )
print $completed->format( 'j/M/Y \@ g:ia' );
2016-04-17 13:14:33 +01:00
else
print '<em>pending</em>';
2016-04-08 15:38:57 +01:00
?></p>
<p><strong>Invoice Sent:</strong> <?php
$tz = new DateTimeZone('UTC');
$sent = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['sent'],$timezone=$tz);
if ( $sent )
print $sent->format( 'j/M/Y \@ g:ia' );
2016-04-17 13:14:33 +01:00
else
print '<em>pending</em>';
2016-04-08 15:38:57 +01:00
?></p>
</div>
</div>
<?php print theme( 'fulcrm_shoppingcart_transaction_mailshots', array( 'transaction' => $transaction ) ); ?>
</div>