in file path:
SR\DeliveryDate\view\adminhtml\templates\order_info_shipping_info.phtml
code:
<section class="admin__page-section" id="delivery-date-content">
<div class="admin__page-section-title">
<span class="title"><?= $block->escapeHtml(__('Delivery Date Information')) ?></span>
</div>
<div class="admin__page-section-content">
<div id="delivery-date">
<strong><?= __('Delivery Date') ?></strong>
<span><?= $block->getDeliveryDate() ?></span>
</div>
<div id="delivery-comment">
<strong><?= __('Comment') ?>:</strong>
<br/>
<?= $block->getDeliveryComment() ?>
</div>
<div id="delivery-test">
<strong><?= __('Test') ?>:</strong>
<br/>
<?php
$orderid = 33;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('Magento\Sales\Api\Data\OrderInterface')->load($orderid);
//fetch whole order information
//print_r($order->getData());
//Or fetch specific information
//echo $order->getIncrementId();
//echo $order->getGrandTotal();
//echo $order->getSubtotal();
echo $order->getDeliveryDropdown();
?>
</div>
</div>
</section>
<script type="text/javascript">
require(
['jquery'],
function($) {
$('#delivery-date-content').insertAfter($('.order-view-billing-shipping'));
}
);
</script>
In line:
$orderid = 33;
I want get dynamically order number after place order.
Can anyone help create block and call to phtml file?