<?php
$title = ___("Self-Service Store");
$this->setLayout('layout.phtml');
$this->headScript()
    ->appendFile($this->_scriptJs('self-service.js'));
?>
<?php echo $this->blocks('self-service/top') ?>
<p><?php __e('You have %s credits (%sTransaction History%s)', '<strong>' . (int)$balance . '</strong>',
    '<a href="' . $this->url('self-service/history'). '">', '</a>') ?></p>
<?php echo $this->blocks('self-service/before-items') ?>
<?php if (!count($products)) : ?>
    <p><?php __e('There are no products available to order with credits') ?></p>
<?php else: ?>
<?php
    $current = $left = $this->placeholder('product-coll-left');
    $right = $this->placeholder('product-coll-right');
    foreach ($products as $product) {
        $current->captureStart();
        include $this->_script('self-service/_product.phtml');
        $current->captureEnd();
        $current = (($current === $left) ? $right : $left);
    }
?>

<div class="am-ss-layout-two-coll">
    <div class="am-ss-layout-two-coll-left">
        <div class="am-ss-layout-two-coll-content">
            <?php echo $left ?>
        </div>
    </div>
    <div class="am-ss-layout-two-coll-right">
        <div class="am-ss-layout-two-coll-content">
            <?php echo $right ?>
        </div>
    </div>
</div>
<?php endif; ?>
<?php echo $paginator->render(); ?>
<?php echo $this->blocks('self-service/bottom') ?>