<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// phpcs:disable Magento2.Templates.ThisInTemplate

/** @var $block Magento\Checkout\Block\Cart\Item\Renderer */

$_item = $block->getItem();
$taxDataHelper = $this->helper(Magento\Tax\Helper\Data::class);
?>
<tbody class="cart item">
    <tr>
        <td class="col item" data-th="<?= $block->escapeHtml(__('Product Name')) ?>">
            <span class="product-item-photo">
                <?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?>
            </span>
            <div class="product-item-details">
                <strong class="product name product-item-name">
                    <?= $block->escapeHtml($block->getProductName()) ?>
                </strong>
                <?php if ($_options = $block->getOptionList()) :?>
                    <dl class="item-options">
                        <?php foreach ($_options as $_option) :?>
                            <?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
                            <dt><?= $block->escapeHtml($_option['label']) ?></dt>
                            <dd>
                                <?php if (isset($_formatedOptionValue['full_view'])) :?>
                                    <?= /* @noEscape */ $_formatedOptionValue['full_view'] ?>
                                <?php else :?>
                                    <?= /* @noEscape */ $_formatedOptionValue['value'] ?>
                                <?php endif; ?>
                            </dd>
                        <?php endforeach; ?>
                    </dl>
                <?php endif;?>
                <?php if ($addtInfoBlock = $block->getProductAdditionalInformationBlock()) :?>
                    <?= $addtInfoBlock->setItem($_item)->toHtml() ?>
                <?php endif;?>
            </div>
        </td>
        <td class="col price" data-th="<?= $block->escapeHtml(__('Price')) ?>">
            <?php if ($taxDataHelper->displayCartPriceInclTax() || $taxDataHelper->displayCartBothPrices()) :?>
                <span class="price-including-tax" data-label="<?= $block->escapeHtml(__('Incl. Tax')) ?>">
                    <?= $block->getUnitPriceInclTaxHtml($_item) ?>
                </span>
            <?php endif; ?>
            <?php if ($taxDataHelper->displayCartPriceExclTax() || $taxDataHelper->displayCartBothPrices()) :?>
                <span class="price-excluding-tax" data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>">
                    <?= $block->getUnitPriceExclTaxHtml($_item) ?>
                </span>
            <?php endif; ?>
        </td>
        <td class="col qty"
            data-th="<?= $block->escapeHtml(__('Qty')) ?>"
        >
            <span class="qty"><?= $block->escapeHtml($_item->getQty()) ?></span>
        </td>
        <td class="col subtotal" data-th="<?= $block->escapeHtml(__('Subtotal')) ?>">
            <?php if ($taxDataHelper->displayCartPriceInclTax() || $taxDataHelper->displayCartBothPrices()) :?>
                <span class="price-including-tax" data-label="<?= $block->escapeHtml(__('Incl. Tax')) ?>">
                    <?= $block->getRowTotalInclTaxHtml($_item) ?>
                </span>
            <?php endif; ?>
            <?php if ($taxDataHelper->displayCartPriceExclTax() || $taxDataHelper->displayCartBothPrices()) :?>
                <span class="price-excluding-tax" data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>">
                    <?= $block->getRowTotalExclTaxHtml($_item) ?>
                </span>
            <?php endif; ?>
        </td>
    </tr>
</tbody>
