<commit_before><?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
/** @var $block \Magento\Bundle\Block\Sales\Order\Items\Renderer */
$parentItem = $block->getItem();
$items = array_merge([$parentItem], $parentItem->getChildrenItems());
$index = 0;
$prevOptionId = '';
?>

<?php foreach ($items as $item) : ?>

    <?php if ($block->getItemOptions()
        || $parentItem->getDescription()
        || $this->helper(Magento\GiftMessage\Helper\Message::class)->isMessagesAllowed('order_item', $parentItem)
        && $parentItem->getGiftMessageId()) : ?>
        <?php $showLastRow = true; ?>
    <?php else : ?>
        <?php $showLastRow = false; ?>
    <?php endif; ?>

    <?php if ($item->getParentItem()) : ?>
        <?php $attributes = $block->getSelectionAttributes($item) ?>
        <?php if ($prevOptionId != $attributes['option_id']) : ?>
            <tr class="options-label">
                <td class="col label" colspan="5"><?= $block->escapeHtml($attributes['option_label']); ?></td>
            </tr>
            <?php $prevOptionId = $attributes['option_id'] ?>
        <?php endif; ?>
    <?php endif; ?>
<tr id="order-item-row-<?= /* @noEscape */ $item->getId() ?>"
    class="<?php if ($item->getParentItem()) : ?>
        item-options-container
    <?php else : ?>
        item-parent
    <?php endif; ?>"
    <?php if ($item->getParentItem()) : ?>
        data-th="<?= $block->escapeHtmlAttr($attributes['option_label']); ?>"
    <?php endif; ?>>
    <?php if (!$item->getParentItem()) : ?>
        <td class="col name" data-th="<?= $block->escapeHtmlAttr(__('Product Name')); ?>">
            <strong class="product name product-item-name"><?= $block->escapeHtml($item->getName()); ?></strong>
        </td>
    <?php else : ?>
        <td class="col value" data-th="<?= $block->escapeHtmlAttr(__('Product Name')); ?>">
            <?= $block->getValueHtml($item); ?>
        </td>
    <?php endif; ?>
    <td class="col sku" data-th="<?= $block->escapeHtmlAttr(__('SKU')); ?>">
        <?= /* @noEscape */ $block->prepareSku($item->getSku()); ?>
    </td>
    <td class="col price" data-th="<?= $block->escapeHtmlAttr(__('Price')); ?>">
        <?php if (!$item->getParentItem()) : ?>
            <?= /* @noEscape */ $block->getItemPriceHtml(); ?>
        <?php else : ?>
            &nbsp;
        <?php endif; ?>
    </td>
    <td class="col qty" data-th="<?= $block->escapeHtmlAttr(__('Quantity')); ?>">
        <?php if (($item->getParentItem() && $block->isChildCalculated()) ||
        (!$item->getParentItem() && !$block->isChildCalculated()) ||
        ($item->getQtyShipped() > 0 && $item->getParentItem() && $block->isShipmentSeparately())) : ?>
            <ul class="items-qty">
        <?php endif; ?>
        <?php if (($item->getParentItem() && $block->isChildCalculated()) ||
            (!$item->getParentItem() && !$block->isChildCalculated())) : ?>
            <?php if ($item->getQtyOrdered() > 0) : ?>
                <li class="item">
                    <span class="title"><?= $block->escapeHtml(__('Ordered')); ?></span>
                    <span class="content"><?= /* @noEscape */ $item->getQtyOrdered() * 1; ?></span>
                </li>
            <?php endif; ?>
            <?php if ($item->getQtyShipped() > 0 && !$block->isShipmentSeparately()) : ?>
                <li class="item">
                    <span class="title"><?= $block->escapeHtml(__('Shipped')); ?></span>
                    <span class="content"><?= /* @noEscape */ $item->getQtyShipped() * 1; ?></span>
                </li>
            <?php endif; ?>
            <?php if ($item->getQtyCanceled() > 0) : ?>
                <li class="item">
                    <span class="title"><?= $block->escapeHtml(__('Canceled')); ?></span>
                    <span class="content"><?= /* @noEscape */ $item->getQtyCanceled() * 1; ?></span>
                </li>
            <?php endif; ?>
            <?php if ($item->getQtyRefunded() > 0) : ?>
                <li class="item">
                    <span class="title"><?= $block->escapeHtml(__('Refunded')); ?></span>
                    <span class="content"><?= /* @noEscape */ $item->getQtyRefunded() * 1; ?></span>
                </li>
            <?php endif; ?>
        <?php elseif ($item->getQtyShipped() > 0 && $item->getParentItem() && $block->isShipmentSeparately()) : ?>
            <li class="item">
                <span class="title"><?= $block->escapeHtml(__('Shipped')); ?></span>
                <span class="content"><?= /* @noEscape */ $item->getQtyShipped() * 1; ?></span>
            </li>
        <?php else : ?>
            <span class="content"><?= /* @noEscape */ $parentItem->getQtyOrdered() * 1; ?></span>
        <?php endif; ?>
        <?php if (($item->getParentItem() && $block->isChildCalculated()) ||
        (!$item->getParentItem() && !$block->isChildCalculated()) ||
        ($item->getQtyShipped() > 0 && $item->getParentItem() && $block->isShipmentSeparately())) :?>
            </ul>
        <?php endif; ?>
    </td>
    <td class="col subtotal" data-th="<?= $block->escapeHtmlAttr(__('Subtotal')) ?>">
        <?php if (!$item->getParentItem()) : ?>
            <?= /* @noEscape */ $block->getItemRowTotalHtml(); ?>
        <?php else : ?>
            &nbsp;
        <?php endif; ?>
    </td>
</tr>
<?php endforeach; ?>

<?php if ($showLastRow && (($options = $block->getItemOptions()) || $block->escapeHtml($item->getDescription()))) : ?>
<tr>
    <td class="col options" colspan="5">
        <?php if ($options = $block->getItemOptions()) : ?>
            <dl class="item-options">
                <?php foreach ($options as $option) : ?>
                    <dt><?= $block->escapeHtml($option['label']) ?></dt>
                    <?php if (!$block->getPrintStatus()) : ?>
                        <?php $formattedOptionValue = $block->getFormatedOptionValue($option) ?>
                        <dd<?php if (isset($formattedOptionValue['full_view'])) : ?>
                            class="tooltip wrapper"
                        <?php endif; ?>>
                            <?= /* @noEscape */ $formattedOptionValue['value'] ?>
                            <?php if (isset($formattedOptionValue['full_view'])) : ?>
                                <div class="tooltip content">
                                    <dl class="item options">
                                        <dt><?= $block->escapeHtml($option['label']); ?></dt>
                                        <dd><?= /* @noEscape */ $formattedOptionValue['full_view']; ?></dd>
                                    </dl>
                                </div>
                            <?php endif; ?>
                        </dd>
                    <?php else : ?>
                        <dd><?= $block->escapeHtml((isset($option['print_value']) ?
                                $option['print_value'] :
                                $option['value'])); ?>
                        </dd>
                    <?php endif; ?>
                <?php endforeach; ?>
            </dl>
        <?php endif; ?>
        <?= $block->escapeHtml($item->getDescription()); ?>
    </td>
</tr>
<?php endif; ?><commit_msg>#68780 adjust bundle items order template, <commit_after><?php
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
/** @var $block \Magento\Bundle\Block\Sales\Order\Items\Renderer */
$parentItem = $block->getItem();
$items = array_merge([$parentItem], $parentItem->getChildrenItems());
$index = 0;
$prevOptionId = '';
?>

<?php foreach ($items as $item) : ?>

    <?php if ($block->getItemOptions()
        || $parentItem->getDescription()
        || $this->helper(Magento\GiftMessage\Helper\Message::class)->isMessagesAllowed('order_item', $parentItem)
        && $parentItem->getGiftMessageId()) : ?>
        <?php $showLastRow = true; ?>
    <?php else : ?>
        <?php $showLastRow = false; ?>
    <?php endif; ?>

    <?php if ($item->getParentItem()) : ?>
        <?php $attributes = $block->getSelectionAttributes($item) ?>
        <?php if ($prevOptionId != $attributes['option_id']) : ?>
            <tr
                role="row"
                class="options-label"
            >
                <td
                    role="gridcell"
                    class="col label"
                    colspan="5"
                >
                    <?= $block->escapeHtml($attributes['option_label']); ?>
                </td>
            </tr>
            <?php $prevOptionId = $attributes['option_id'] ?>
        <?php endif; ?>
    <?php endif; ?>
    <tr
        role="row"
        id="order-item-row-<?= /* @noEscape */ $item->getId() ?>"
        class="<?php if ($item->getParentItem()) : ?>
            item-options-container
        <?php else : ?>
            item-parent
        <?php endif; ?>"
        <?php if ($item->getParentItem()) : ?>
            data-th="<?= $block->escapeHtmlAttr($attributes['option_label']); ?>"
        <?php endif; ?>
    >
        <?php if (!$item->getParentItem()) : ?>
            <td
                role="gridcell"
                class="col name"
                data-th="<?= $block->escapeHtmlAttr(__('Product Name')); ?>"
            >
                <?= $block->escapeHtml($item->getName()); ?>
            </td>
        <?php else : ?>
            <td
                role="gridcell"
                class="col value"
                data-th="<?= $block->escapeHtmlAttr(__('Product Name')); ?>"
            >
                <?= $block->getValueHtml($item); ?>
            </td>
        <?php endif; ?>
        <td
            role="gridcell"
            class="col sku"
            data-th="<?= $block->escapeHtmlAttr(__('SKU')); ?>"
        >
            <?= /* @noEscape */ $block->prepareSku($item->getSku()); ?>
        </td>
        <td
            role="gridcell"
            class="col price"
            data-th="<?= $block->escapeHtmlAttr(__('Price')); ?>"
        >
            <?php if (!$item->getParentItem()) : ?>
                <?= /* @noEscape */ $block->getItemPriceHtml(); ?>
            <?php else : ?>
                &nbsp;
            <?php endif; ?>
        </td>
        <td
            role="gridcell"
            class="col qty"
            data-th="<?= $block->escapeHtmlAttr(__('Quantity')); ?>"
        >
            <?php if (($item->getParentItem() && $block->isChildCalculated()) ||
                (!$item->getParentItem() && !$block->isChildCalculated())) : ?>
                <?php if ($item->getQtyOrdered() > 0) : ?>
                    <?= $block->escapeHtmlAttr(__('Ordered')) ?>:&nbsp;<?= /* @noEscape */ $item->getQtyOrdered() * 1; ?>
                <?php endif; ?>
                <?php if ($item->getQtyShipped() > 0 && !$block->isShipmentSeparately()) : ?>
                    <?= $block->escapeHtmlAttr(__('Shipped')) ?>:&nbsp;<?= /* @noEscape */ $item->getQtyShipped() * 1; ?>
                <?php endif; ?>
                <?php if ($item->getQtyCanceled() > 0) : ?>
                    <?= $block->escapeHtmlAttr(__('Canceled')) ?>:&nbsp;<?= /* @noEscape */ $item->getQtyCanceled() * 1; ?>
                <?php endif; ?>
                <?php if ($item->getQtyRefunded() > 0) : ?>
                    <?= $block->escapeHtmlAttr(__('Refunded')) ?>:&nbsp;<?= /* @noEscape */ $item->getQtyRefunded() * 1; ?>
                <?php endif; ?>
            <?php elseif ($item->getQtyShipped() > 0 && $item->getParentItem() && $block->isShipmentSeparately()) : ?>
                <?= $block->escapeHtmlAttr(__('Shipped')) ?>:&nbsp;<?= /* @noEscape */ $item->getQtyShipped() * 1; ?>
            <?php else : ?>
                <?= /* @noEscape */ $parentItem->getQtyOrdered() * 1; ?>
            <?php endif; ?>
        </td>
        <td
            role="gridcell"
            class="col subtotal"
            data-th="<?= $block->escapeHtmlAttr(__('Subtotal')) ?>"
        >
            <?php if (!$item->getParentItem()) : ?>
                <?= /* @noEscape */ $block->getItemRowTotalHtml(); ?>
            <?php else : ?>
                &nbsp;
            <?php endif; ?>
        </td>
    </tr>
<?php endforeach; ?>

<?php if ($showLastRow && (($options = $block->getItemOptions()) || $block->escapeHtml($item->getDescription()))) : ?>
<tr role="row">
    <td
        role="gridcell"
        class="col options"
        colspan="5"
    >
        <?php if ($options = $block->getItemOptions()) : ?>
            <dl class="item-options">
                <?php foreach ($options as $option) : ?>
                    <dt>
                        <?= $block->escapeHtml($option['label']) ?>
                    </dt>
                    <?php if (!$block->getPrintStatus()) : ?>
                        <?php $formattedOptionValue = $block->getFormatedOptionValue($option) ?>
                        <dd
                            <?php if (isset($formattedOptionValue['full_view'])) : ?>
                                class="tooltip wrapper"
                            <?php endif; ?>>
                            <?= /* @noEscape */ $formattedOptionValue['value'] ?>
                            <?php if (isset($formattedOptionValue['full_view'])) : ?>
                                <div class="tooltip content">
                                    <dl class="item options">
                                        <dt>
                                            <?= $block->escapeHtml($option['label']); ?>
                                        </dt>
                                        <dd>
                                            <?= /* @noEscape */ $formattedOptionValue['full_view']; ?>
                                        </dd>
                                    </dl>
                                </div>
                            <?php endif; ?>
                        </dd>
                    <?php else : ?>
                        <dd>
                            <?= $block->escapeHtml((isset($option['print_value']) ?
                                $option['print_value'] :
                                $option['value']));
                            ?>
                        </dd>
                    <?php endif; ?>
                <?php endforeach; ?>
            </dl>
        <?php endif; ?>
        <?= $block->escapeHtml($item->getDescription()); ?>
    </td>
</tr>
<?php endif; ?>
{'fraction_non_alphanumeric': 0.2031520011059653, 'fraction_numerical': 0.0025575447570332483, 'mean_word_length': 1.6546788990825687, 'pattern_counts': {'":': 0, '<': 289, '<?xml version=': 0, '>': 443, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1214502', 'n_tokens_mistral': 4118, 'n_tokens_neox': 4025, 'n_words': 711}