Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
- <body>
- <referenceContainer name="content">
- <block class="MagentoSalesBlockAdminhtmlOrderViewInfo" name="my_module_name" template="my_module::list.phtml"/>
- </referenceContainer>
- </body>
- </page>
- <?php
- namespace LearningRewriteSalesBlockAdminhtmlOrderView;
- class Custom extends MagentoBackendBlockTemplate
- {
- }
- <?xml version="1.0"?>
- <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
- <body>
- <referenceBlock name="order_info">
- <block class="LearningRewriteSalesBlockAdminhtmlOrderViewCustom" name="sales_order_view_custom" template="order/view/custom.phtml" />
- </referenceBlock>
- </body>
- </page>
- <h1>Hi, I am here!</h1>
- protected function _beforeToHtml()
- {
- if (!$this->getParentBlock()) {
- throw new MagentoFrameworkExceptionLocalizedException(
- __('Please correct the parent block for this block.')
- );
- }
- $this->setOrder($this->getParentBlock()->getOrder());
- foreach ($this->getParentBlock()->getOrderInfoData() as $key => $value) {
- $this->setDataUsingMethod($key, $value);
- }
- parent::_beforeToHtml();
- }
- <block class="MagentoSalesBlockAdminhtmlOrderViewTabs" name="sales_order_tabs">
- <block class="MagentoSalesBlockAdminhtmlOrderViewTabInfo" name="order_tab_info" template="order/view/tab/info.phtml">
- <block class="MagentoSalesBlockAdminhtmlOrderViewMessages" name="order_messages"/>
- <block class="MagentoSalesBlockAdminhtmlOrderViewInfo" name="order_info" template="order/view/info.phtml"/>
- <block class="MagentoSalesBlockAdminhtmlOrderViewItems" name="order_items" template="order/view/items.phtml">
- <block class="MagentoSalesBlockAdminhtmlOrderViewItemsRendererDefaultRenderer" as="default" template="order/view/items/renderer/default.phtml"/>
- <block class="MagentoSalesBlockAdminhtmlItemsColumnQty" name="column_qty" template="items/column/qty.phtml" group="column"/>
- <block class="MagentoSalesBlockAdminhtmlItemsColumnName" name="column_name" template="items/column/name.phtml" group="column"/>
- <block class="MagentoFrameworkViewElementTextListText" name="order_item_extra_info"/>
- </block>
- <?xml version="1.0"?>
- <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
- <body>
- <referenceContainer name="left">
- <referenceContainer name="payment_additional_info">
- <block class="IbnabOrderAdBlockAdminhtmlOrderViewView" name="sales_order_view_ad" template="order/view/ad.phtml"/>
- </referenceContainer>
- </referenceContainer>
- </body>
- </page>
- <p></p>
- <h1>Our Adiitional Block </h1>
- <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
- <body>
- <referenceBlock name="order_info">
- <action method="setTemplate">
- <argument name="template" translate="true" xsi:type="string">MD_Demo::order/view/info.phtml</argument>
- </action>
- </referenceBlock>
- </body>
- </page>
- <?php $_order = $block->getOrder() ?>
- <?php
- $orderAdminDate = $block->formatDate(
- $block->getOrderAdminDate($_order->getCreatedAt()),
- IntlDateFormatter::MEDIUM,
- true
- );
- $orderStoreDate = $block->formatDate(
- $_order->getCreatedAt(),
- IntlDateFormatter::MEDIUM,
- true,
- $block->getTimezoneForStore($_order->getStore())
- );
- ?>
- <section class="admin__page-section order-view-account-information">
- <div class="admin__page-section-title">
- <span class="title"><?php /* @escapeNotVerified */ echo __('Order & Account Information') ?></span>
- </div>
- <div class="admin__page-section-content">
- <div class="admin__page-section-item order-information">
- <?php /* Order Information */?>
- <?php if ($_order->getEmailSent()):
- $_email = __('The order confirmation email was sent');
- else:
- $_email = __('The order confirmation email is not sent');
- endif; ?>
- <div class="admin__page-section-item-title">
- <span class="title">
- <?php if ($block->getNoUseOrderLink()): ?>
- <?php /* @escapeNotVerified */ echo __('Order # %1', $_order->getRealOrderId()) ?> (<span><?php /* @escapeNotVerified */ echo $_email ?></span>)
- <?php else: ?>
- <a href="<?php /* @escapeNotVerified */ echo $block->getViewUrl($_order->getId()) ?>"><?php /* @escapeNotVerified */ echo __('Order # %1', $_order->getRealOrderId()) ?></a>
- <span>(<?php /* @escapeNotVerified */ echo $_email ?>)</span>
- <?php endif; ?>
- </span>
- </div>
- <div class="admin__page-section-item-content">
- <table class="admin__table-secondary order-information-table">
- <tr>
- <th><?php /* @escapeNotVerified */ echo __('Order Date') ?></th>
- <td><?php /* @escapeNotVerified */ echo $orderAdminDate ?></td>
- </tr>
- <?php if ($orderAdminDate != $orderStoreDate):?>
- <tr>
- <th><?php /* @escapeNotVerified */ echo __(
- 'Order Date (%1)',
- $block->getTimezoneForStore($_order->getStore())
- ) ?></th>
- <td><?php /* @escapeNotVerified */ echo $orderStoreDate ?></td>
- </tr>
- <?php endif;?>
- <tr>
- <th><?php /* @escapeNotVerified */ echo __('Order Status') ?></th>
- <td><span id="order_status"><?php /* @escapeNotVerified */ echo $_order->getStatusLabel() ?></span></td>
- </tr>
- <?php echo $block->getChildHtml(); ?>
- <?php if ($block->isSingleStoreMode() == false):?>
- <tr>
- <th><?php /* @escapeNotVerified */ echo __('Purchased From') ?></th>
- <td><?php /* @escapeNotVerified */ echo $block->getOrderStoreName() ?></td>
- </tr>
- <?php endif; ?>
- <?php if ($_order->getRelationChildId()): ?>
- <tr>
- <th><?php /* @escapeNotVerified */ echo __('Link to the New Order') ?></th>
- <td><a href="<?php /* @escapeNotVerified */ echo $block->getViewUrl($_order->getRelationChildId()) ?>">
- <?php /* @escapeNotVerified */ echo $_order->getRelationChildRealId() ?>
- </a></td>
- </tr>
- <?php endif; ?>
- <?php if ($_order->getRelationParentId()): ?>
- <tr>
- <th><?php /* @escapeNotVerified */ echo __('Link to the Previous Order') ?></th>
- <td><a href="<?php /* @escapeNotVerified */ echo $block->getViewUrl($_order->getRelationParentId()) ?>">
- <?php /* @escapeNotVerified */ echo $_order->getRelationParentRealId() ?>
- </a></td>
- </tr>
- <?php endif; ?>
- <?php if ($_order->getRemoteIp() && $block->shouldDisplayCustomerIp()): ?>
- <tr>
- <th><?php /* @escapeNotVerified */ echo __('Placed from IP') ?></th>
- <td><?php /* @escapeNotVerified */ echo $_order->getRemoteIp(); echo($_order->getXForwardedFor()) ? ' (' . $block->escapeHtml($_order->getXForwardedFor()) . ')' : ''; ?></td>
- </tr>
- <?php endif; ?>
- <?php if ($_order->getGlobalCurrencyCode() != $_order->getBaseCurrencyCode()): ?>
- <tr>
- <th><?php /* @escapeNotVerified */ echo __('%1 / %2 rate:', $_order->getGlobalCurrencyCode(), $_order->getBaseCurrencyCode()) ?></th>
- <td><?php /* @escapeNotVerified */ echo $_order->getBaseToGlobalRate() ?></td>
- </tr>
- <?php endif; ?>
- <?php if ($_order->getBaseCurrencyCode() != $_order->getOrderCurrencyCode()): ?>
- <tr>
- <th><?php /* @escapeNotVerified */ echo __('%1 / %2 rate:', $_order->getOrderCurrencyCode(), $_order->getBaseCurrencyCode()) ?></th>
- <th><?php /* @escapeNotVerified */ echo $_order->getBaseToOrderRate() ?></th>
- </tr>
- <?php endif; ?>
- </table>
- </div>
- </div>
- <div class="admin__page-section-item order-account-information">
- <?php /* Account Information */?>
- <div class="admin__page-section-item-title">
- <span class="title"><?php /* @escapeNotVerified */ echo __('Account Information') ?></span>
- <div class="actions"><?php /* @escapeNotVerified */ echo $block->getAccountEditLink()?></div>
- </div>
- <div class="admin__page-section-item-content">
- <table class="admin__table-secondary order-account-information-table">
- <tr>
- <th><?php /* @escapeNotVerified */ echo __('Customer Name') ?></th>
- <td>
- <?php if ($_customerUrl = $block->getCustomerViewUrl()) : ?>
- <a href="<?php /* @escapeNotVerified */ echo $_customerUrl ?>" target="_blank">
- <span><?php echo $block->escapeHtml($_order->getCustomerName()) ?></span>
- </a>
- <?php else: ?>
- <?php echo $block->escapeHtml($_order->getCustomerName()) ?>
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <th><?php /* @escapeNotVerified */ echo __('Email') ?></th>
- <td><a href="mailto:<?php echo $block->escapeHtml($_order->getCustomerEmail()) ?>"><?php echo $block->escapeHtml($_order->getCustomerEmail()) ?></a></td>
- </tr>
- <?php if ($_groupName = $block->getCustomerGroupName()) : ?>
- <tr>
- <th><?php /* @escapeNotVerified */ echo __('Customer Group') ?></th>
- <td><?php /* @escapeNotVerified */ echo $_groupName ?></td>
- </tr>
- <?php endif; ?>
- <?php foreach ($block->getCustomerAccountData() as $data):?>
- <tr>
- <th><?php /* @escapeNotVerified */ echo $data['label'] ?></th>
- <td><?php /* @escapeNotVerified */ echo $data['value'] ?></td>
- </tr>
- <?php endforeach;?>
- </table>
- </div>
- </div>
- </div>
- </section>
- <section class="admin__page-section order-addresses">
- <div class="admin__page-section-title">
- <span class="title"><?php /* @escapeNotVerified */ echo __('Address Information') ?></span>
- </div>
- <div class="admin__page-section-content">
- <div class="admin__page-section-item order-billing-address">
- <?php /* Billing Address */?>
- <div class="admin__page-section-item-title">
- <span class="title"><?php /* @escapeNotVerified */ echo __('Billing Address') ?></span>
- <div class="actions"><?php /* @escapeNotVerified */ echo $block->getAddressEditLink($_order->getBillingAddress()); ?></div>
- </div>
- <address class="admin__page-section-item-content"><?php /* @escapeNotVerified */ echo $block->getFormattedAddress($_order->getBillingAddress()); ?></address>
- </div>
- <?php if (!$block->getOrder()->getIsVirtual()): ?>
- <div class="admin__page-section-item order-shipping-address">
- <?php /* Shipping Address */ ?>
- <div class="admin__page-section-item-title">
- <span class="title"><?php /* @escapeNotVerified */ echo __('Shipping Address') ?></span>
- <div class="actions"><?php /* @escapeNotVerified */ echo $block->getAddressEditLink($_order->getShippingAddress()); ?></div>
- </div>
- <address class="admin__page-section-item-content"><?php /* @escapeNotVerified */ echo $block->getFormattedAddress($_order->getShippingAddress()); ?></address>
- </div>
- <?php endif; ?>
- </div>
- </section>
- <section>
- <H1>HERE IS IT MY BLOCK<H1>
- </section>
- <?xml version="1.0"?>
- <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
- <body>
- <referenceContainer name="content">
- <block class="TccShippingBlockAdminhtmlOrderViewCustom" name="sales_order_view_custom" template="order/view/custom.phtml"/>
- </referenceContainer>
- </body>
- </page>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement