account/credits.php
Página de "Mi créditos" o "Mi saldo" - para manejo de saldo o dinero en cuenta
Página "Mi crédito" o "Mi saldo"
Este template permite mostrar el crédito-dinero o saldo que tenga un cliente en su cuenta.
Objetos disponibles
Descripción
$_order
Pedidos con créditos.
$_totalOrders
Cantidad de pedidos.
$_credits
Créditos de usuarios.
$_creditsTotal
Cantidad de créditos.
Código de ejemplo
<h1>Mis <?=Configuration::value('CREDITS_NAME')?></h1>
<h2>Tienes <?=$_front->price(UserCredit::toAmount($_auth->user()->credits()))?> <?=Configuration::value('CREDITS_NAME')?></h2>
<?php if($_creditsTotal): ?>
<table class="account">
<tr>
<th>Fecha</th>
<th>Concepto</th>
<th>Monto</th>
</tr>
<?php while($_credits->getNext()): ?>
<tr>
<td class="fecha"><?=$_front->date($_credits->get('created'))?></td>
<td><?=$_credits->description('Carga de '.Configuration::value('CREDITS_NAME'))?></td>
<td class="total"><?=$_front->price(UserCredit::toAmount($_credits->get('amount')))?></td>
</tr>
<?php endwhile; ?>
</table>
<?php endif; ?>
<h2>Historial de uso</h2>
<?php if($_totalOrders): ?>
<table class="account">
<tr>
<th>Fecha</th>
<th>Pedido</th>
<th>Estado</th>
<th><?=Configuration::value('CREDITS_NAME')?></th>
<th>Total</th>
</tr>
<?php while($_order->getNext()): ?>
<tr>
<td class="fecha"><a href="<?=$_order->getURL()?>">
<?=$_front->date($_order->get('created'))?>
</a></td>
<td class="id"><a href="<?=$_order->getURL()?>">
<?=$_order->getId()?>
</a></td>
<td><a href="<?=$_order->getURL()?>">
<span class="estado <?=($_order->get('status')->get('approved') ? 'ok ' : '')?>"><?=$_order->get('status')->get('name')?></span>
</a></td>
<td class="total"><a href="<?=$_order->getURL()?>"><?=$_front->price($_order->get('credits'))?></a></td>
<td class="total"><a href="<?=$_order->getURL()?>"><?=$_front->price($_order->get('total'))?></a></td>
</tr>
<?php endwhile; ?>
</table>
<?php endif; ?>
Last updated
Was this helpful?