<h1>Checkout</h1>

<table>
    <thead><tr><th>Product</th><th>Price</th><th>Qty</th><th>Line</th></tr></thead>
    <tbody>
    <?php foreach ($cart['items'] as $row): ?>
        <tr>
            <td><?= h($row['name']) ?></td>
            <td><?= number_format($row['price'], 2) ?></td>
            <td><?= (int)$row['qty'] ?></td>
            <td><?= number_format($row['price'] * $row['qty'], 2) ?></td>
        </tr>
    <?php endforeach; ?>
    </tbody>
    <tfoot>
    <tr><th colspan="3" style="text-align:right">Total</th><th><?= number_format($total, 2) ?></th></tr>
    </tfoot>
</table>

<h3>Your details</h3>
<?= $this->Form->create() ?>
<?= $this->Form->control('name', ['required'=>true]) ?>
<?= $this->Form->control('email', ['required'=>true]) ?>
<?= $this->Form->control('phone') ?>
<?= $this->Form->control('address', ['type'=>'textarea','required'=>true]) ?>
<?= $this->Form->control('notes', ['type'=>'textarea']) ?>
<?= $this->Form->button('Place order') ?>
<?= $this->Form->end() ?>
