<?php
/**
 * Maho
 *
 * @category    design
 * @package     rwd_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2022 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 $_invoice   = $this->getInvoice() ?>
<?php $_order     = $this->getOrder() ?>

<?php if ($_invoice && $_order): ?>

    <?php $_items     = $_order->getAllItems() ?>
    <?php $_itemCount = count($_items) ?>
    <table class="items" cellpadding="0" cellspacing="0" border="0">
        <thead>
            <tr>
                <th class="cell-name">
                    <?php if($_itemCount > 1): echo $this->__('Items in your order'); else: echo $this->__('Item in your order'); endif; ?>
                </th>
                <th class="cell-name align-center">
                    <?= $this->__('Qty') ?>
                </th>
                <th class="cell-name align-right">
                    <?= $this->__('Price') ?>
                </th>
            </tr>
        </thead>

        <?php $i=0; foreach ($_invoice->getAllItems() as $_item): ?>
        <?php if($_item->getOrderItem()->getParentItem()) continue; else $i++; ?>
            <?= $this->getItemHtml($_item) ?>
        <?php endforeach ?>

        <tfoot>
            <?= $this->getChildHtml('invoice_totals') ?>
        </tfoot>
    </table>
<?php endif ?>
