<?php
/**
 * Maho
 *
 * @category    design
 * @package     base_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_Sales_Block_Order_Item_Renderer_Default $this */
?>
<?php $_item = $this->getItem() ?>
<?php $_order = $this->getItem()->getOrderItem()->getOrder() ?>
<tr class="border" id="order-item-row-<?= $_item->getId() ?>">
    <td><h4 class="product-name"><?= $this->escapeHtml($_item->getName()) ?></h4>
        <?php if($_options = $this->getItemOptions()): ?>
        <dl class="item-options">
        <?php foreach ($_options as $_option) : ?>
            <dt><?= $this->escapeHtml($_option['label']) ?></dt>
            <?php if (!$this->getPrintStatus()): ?>
                <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
                <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif ?>>
                    <?= $_formatedOptionValue['value'] ?>
                    <?php if (isset($_formatedOptionValue['full_view'])): ?>
                    <div class="truncated_full_value">
                        <dl class="item-options">
                            <dt><?= $this->escapeHtml($_option['label']) ?></dt>
                            <dd><?= $_formatedOptionValue['full_view'] ?></dd>
                        </dl>
                    </div>
                    <?php endif ?>
                </dd>
            <?php else: ?>
                <dd><?= $this->escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) ) ?></dd>
            <?php endif ?>
        <?php endforeach ?>
        </dl>
        <?php endif ?>
        <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
        <?php if ($addInfoBlock) :?>
            <?= $addInfoBlock->setItem($_item->getOrderItem())->toHtml() ?>
        <?php endif ?>
        <?= $this->escapeHtml($_item->getDescription()) ?>
        <?php if($this->canDisplayGiftmessage()): ?>
            <a href="#" id="order-item-gift-message-link-<?= $_item->getId() ?>" class="gift-message-link" onclick="return giftMessageToogle('<?= $_item->getId() ?>')"><?= $this->__('Gift Message') ?></a>
        <?php endif ?>
    </td>
    <td><?= $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
    <td class="a-center"><?= $_item->getQty()*1 ?></td>
</tr>
