![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-shipping/view/adminhtml/templates/order/packaging/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ //phpcs:disable Squiz.PHP.NonExecutableCode.Unreachable /** * @var \Magento\Shipping\Block\Adminhtml\Order\Packaging $block * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> <div class="grid"> <?php $randomId = rand(); ?> <div class="admin__table-wrapper"> <table id="packaging-data-grid-<?= /* @noEscape */ $randomId ?>" class="data-grid"> <thead> <tr> <th class="data-grid-checkbox-cell"> <label class="data-grid-checkbox-cell-inner"> <input type="checkbox" id="select-items-<?= /* @noEscape */ $randomId ?>" class="checkbox admin__control-checkbox" title="<?= $block->escapeHtmlAttr(__('Select All')) ?>"> <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( 'onchange', 'packaging.checkAllItems(this);', 'input#select-items-' . /* @noEscape */ $randomId ) ?> <label for="select-items-<?= /* @noEscape */ $randomId ?>"></label> </label> </th> <th class="data-grid-th"><?= $block->escapeHtml(__('Product Name')) ?></th> <th class="data-grid-th"><?= $block->escapeHtml(__('Weight')) ?></th> <th class="data-grid-th custom-value"> <?= $block->escapeHtml(__('Customs Value')) ?> </th> <?php if (!$block->displayCustomsValue()): ?> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( 'display:none', '#packaging-data-grid-' . $randomId . ' th.custom-value' ) ?> <?php endif ?> <th class="data-grid-th"><?= $block->escapeHtml(__('Qty Ordered')) ?></th> <th class="data-grid-th"><?= $block->escapeHtml(__('Qty')) ?></th> </tr> </thead> <tbody> <?php $i = 0; ?> <?php foreach ($block->getCollection() as $item): ?> <?php $_order = $block->getShipment()->getOrder(); $_orderItem = $_order->getItemById($item->getOrderItemId()); ?> <?php if ($item->getIsVirtual() || ($_orderItem->isShipSeparately() && !($_orderItem->getParentItemId() || $_orderItem->getParentItem())) || (!$_orderItem->isShipSeparately() && ($_orderItem->getParentItemId() || $_orderItem->getParentItem()))): ?> <?php continue; ?> <?php endif; ?> <tr class="data-grid-controls-row data-row <?= ($i++ % 2 != 0) ? '_odd-row' : '' ?>"> <td class="data-grid-checkbox-cell"> <?php $id = $item->getId() ?? $item->getOrderItemId(); ?> <label class="data-grid-checkbox-cell-inner"> <input type="checkbox" name="" id="select-item-<?= /* @noEscape */ $randomId . '-' . $id ?>" value="<?= (int)$id ?>" class="checkbox admin__control-checkbox"> <label for="select-item-<?= /* @noEscape */ $randomId . '-' . $id ?>"></label> </label> </td> <td> <?= $block->escapeHtml($item->getName()) ?> </td> <td data-role="item-weight"> <?= $block->escapeHtml($item->getWeight()) ?> </td> <?php if ($block->displayCustomsValue()) { $customsValueValidation = ' validate-zero-or-greater '; } else { $customsValueValidation = ''; } ?> <td id="custom-value-<?= /* @noEscape */ $randomId . '-' . $id ?>" class="custom-value"> <input type="text" name="customs_value" class="input-text admin__control-text <?= /* @noEscape */ $customsValueValidation ?>" value="<?= $block->escapeHtmlAttr($block->formatPrice($item->getPrice())) ?>" size="10"> </td> <?php if (!$block->displayCustomsValue()): ?> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( 'display:none', 'td#custom-value-' . $randomId . '-' . $id ) ?> <?php endif ?> <td> <?= /* @noEscape */ $item->getOrderItem()->getQtyOrdered() * 1 ?> </td> <td> <input type="hidden" name="price" value="<?= $block->escapeHtml($item->getPrice()) ?>"> <input type="text" name="qty" value="<?= /* @noEscape */ $item->getQty() * 1 ?>" class="input-text admin__control-text qty <?php if ($item->getOrderItem()->getIsQtyDecimal()): ?> qty-decimal <?php endif ?>"> <button type="button" id="packaging-delete-item-<?= /* @noEscape */ $randomId . '-' . $id ?>" class="action-delete" data-action="package-delete-item"> <span><?= $block->escapeHtml(__('Delete')) ?></span> </button> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( 'display:none', 'button#packaging-delete-item-' . $randomId . '-' . $id ) ?> </td> </tr> <?php endforeach; ?> </tbody> </table> <?php $scriptString = <<<script require(['jquery'], function ($) { $("#packaging-data-grid-{$randomId}").on('blur', 'td.custom-value input', function(){packaging.recalcContainerWeightAndCustomsValue(this)}); $("#packaging-data-grid-{$randomId}").on('click', 'button[data-action="package-delete-item"]', function(){packaging.deleteItem(this)}); }); script; ?> <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?> </div> </div>