<?php foreach ($products as $product): ?>
    <div class="item">
        <div class="name"><?= $product['name'] ?></div>
        <div class="image">
            <img src="<?= util('WebShop.WebShop')->image($product) ?>" />
        </div>
        <div class="info">
            <div><?= __('from %d %s', [$product['price'], config('coins')[$shop['coin']]['name']]) ?></div>
            <?php if (util('Number')->nvl($product['stock']) > 0): ?>
                <div><?= __('%d/%d sold', [$product['solds'], $product['stock']]) ?></div>
            <?php else: ?>
                <div><?= __('%d sold', [$product['solds']]) ?></div>
            <?php endif ?>
        </div>
        <div class="buy">
            <?php if (empty($product['stock']) || util('Number')->nvl($product['stock']) > util('Number')->nvl($product['solds'])): ?>
                <a data-ajax href="<?= url_to('/shop/' . $shop['slug'] . '/' . $category['slug'] . '/' . $product['slug']) ?>" class="btn"><?= __('+ details') ?></a>
            <?php else: ?>
                <a data-ajax href="#" disabled class="btn disabled"><?= __('Sold off') ?></a>
            <?php endif ?>
        </div>
    </div>
<?php endforeach ?>

<div class="clear"></div>

<?= $paginator->toHtml() ?>