<?php
/**
 * Maho
 *
 * @category    design
 * @package     rwd_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2023 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php if (($_products = $this->getProductCollection()) && $_products->getSize()): ?>
<h2 class="subtitle products"><?= $this->__('New Products') ?></h2>
<?php $_columnCount = $this->getColumnCount(); ?>
    <table class="products-grid">
    <?php $i=0; foreach ($_products->getItems() as $_product): ?>
        <?php if ($i++%$_columnCount==0): ?>
        <tr>
        <?php endif ?>
            <td>
                <div class="product-wrapper">
                    <a href="<?= $_product->getProductUrl() ?>" title="<?= $this->escapeHtml($_product->getName()) ?>" class="product-image">
                        <?php $_imgSize = 260; ?>
                        <img src="<?= $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize) ?>" alt="<?= $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
                    </a>
                    <h3 class="product-name"><a href="<?= $_product->getProductUrl() ?>" title="<?= $this->escapeHtml($_product->getName()) ?>"><?= $this->escapeHtml($_product->getName()) ?></a></h3>
                    <?= $this->getPriceHtml($_product, true, '-new') ?>
                </div>
            </td>
        <?php if ($i%$_columnCount==0 || $i==count($_products)): ?>
        <tr>
        <?php endif ?>
    <?php endforeach ?>
    </table>
<?php endif ?>
