<?php
/**
 * Maho
 *
 * @category    design
 * @package     rwd_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2024 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)
 */

/** @var Mage_Catalog_Block_Product_List_Upsell $this */
?>
<?php if(count($this->getItemCollection()->getItems())): ?>
<?php $_columnCount = $this->getColumnCount(); ?>
<div class="box-collateral box-up-sell">
    <h2><?= $this->__('You may also be interested in the following product(s)') ?></h2>
    <ul class="products-grid products-grid--max-<?= $_columnCount ?>-col" id="upsell-product-table">
    <?php // $this->setColumnCount(5); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
    <?php $this->resetItemsIterator() ?>
    <?php foreach ($this->getItemCollection()->getItems() as $_link): ?>
        <li>
            <a href="<?= $_link->getProductUrl() ?>" title="<?= $this->escapeHtml($_link->getName()) ?>" class="product-image">
                <img src="<?= $this->helper('catalog/image')->init($_link, 'small_image')->resize(280) ?>" alt="<?= $this->escapeHtml($_link->getName()) ?>" />
            </a>
            <h3 class="product-name"><a href="<?= $_link->getProductUrl() ?>" title="<?= $this->escapeHtml($_link->getName()) ?>"><?= $this->escapeHtml($_link->getName()) ?></a></h3>
            <?= $this->getPriceHtml($_link, true, '-upsell') ?>
            <?= $this->getReviewsSummaryHtml($_link) ?>
        </li>
            <?php /*else: ?>
            <td class="empty">&nbsp;</td>
            <?php endif ?>
        <?php endfor ?>
        </tr>
    <?php endfor; */?>
    <?php endforeach ?>
    </ul>
</div>
<?php endif ?>
