<?php
/**
 * OpenMage
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available at https://opensource.org/license/afl-3-0-php
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
 * @copyright   Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php $_item = $this->getItem() ?>
<?php $_order = $this->getItem()->getOrderItem()->getOrder() ?>
<tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
    <td><h4 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h4>
        <?php if($_options = $this->getItemOptions()): ?>
        <dl class="item-options">
        <?php foreach ($_options as $_option) : ?>
            <dt><?php echo $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 ?>>
                    <?php echo $_formatedOptionValue['value'] ?>
                    <?php if (isset($_formatedOptionValue['full_view'])): ?>
                    <div class="truncated_full_value">
                        <dl class="item-options">
                            <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
                            <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
                        </dl>
                    </div>
                    <?php endif ?>
                </dd>
            <?php else: ?>
                <dd><?php echo $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) :?>
            <?php echo $addInfoBlock->setItem($_item->getOrderItem())->toHtml(); ?>
        <?php endif ?>
        <?php echo $this->escapeHtml($_item->getDescription()) ?>
        <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item->getOrderItem()) && $_item->getGiftMessageId()): ?>
            <a href="#" id="order-item-gift-message-link-<?php echo $_item->getId() ?>" class="gift-message-link" onclick="return giftMessageToogle('<?php echo $_item->getId() ?>')"><?php echo $this->__('Gift Message') ?></a>
        <?php endif ?>
    </td>
    <td><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
    <td class="a-center"><?php echo $_item->getQty()*1 ?></td>
</tr>
