Advertisement
Guest User

Untitled

a guest
Aug 15th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.43 KB | None | 0 0
  1. <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  2. <body>
  3. <referenceContainer name="content">
  4. <block class="MagentoSalesBlockAdminhtmlOrderViewInfo" name="my_module_name" template="my_module::list.phtml"/>
  5. </referenceContainer>
  6. </body>
  7. </page>
  8.  
  9. <?php
  10. namespace LearningRewriteSalesBlockAdminhtmlOrderView;
  11. class Custom extends MagentoBackendBlockTemplate
  12. {
  13.  
  14. }
  15.  
  16. <?xml version="1.0"?>
  17. <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">
  18. <body>
  19. <referenceBlock name="order_info">
  20. <block class="LearningRewriteSalesBlockAdminhtmlOrderViewCustom" name="sales_order_view_custom" template="order/view/custom.phtml" />
  21. </referenceBlock>
  22. </body>
  23. </page>
  24.  
  25. <h1>Hi, I am here!</h1>
  26.  
  27. protected function _beforeToHtml()
  28. {
  29. if (!$this->getParentBlock()) {
  30. throw new MagentoFrameworkExceptionLocalizedException(
  31. __('Please correct the parent block for this block.')
  32. );
  33. }
  34. $this->setOrder($this->getParentBlock()->getOrder());
  35.  
  36. foreach ($this->getParentBlock()->getOrderInfoData() as $key => $value) {
  37. $this->setDataUsingMethod($key, $value);
  38. }
  39.  
  40. parent::_beforeToHtml();
  41. }
  42.  
  43. <block class="MagentoSalesBlockAdminhtmlOrderViewTabs" name="sales_order_tabs">
  44. <block class="MagentoSalesBlockAdminhtmlOrderViewTabInfo" name="order_tab_info" template="order/view/tab/info.phtml">
  45. <block class="MagentoSalesBlockAdminhtmlOrderViewMessages" name="order_messages"/>
  46. <block class="MagentoSalesBlockAdminhtmlOrderViewInfo" name="order_info" template="order/view/info.phtml"/>
  47. <block class="MagentoSalesBlockAdminhtmlOrderViewItems" name="order_items" template="order/view/items.phtml">
  48. <block class="MagentoSalesBlockAdminhtmlOrderViewItemsRendererDefaultRenderer" as="default" template="order/view/items/renderer/default.phtml"/>
  49. <block class="MagentoSalesBlockAdminhtmlItemsColumnQty" name="column_qty" template="items/column/qty.phtml" group="column"/>
  50. <block class="MagentoSalesBlockAdminhtmlItemsColumnName" name="column_name" template="items/column/name.phtml" group="column"/>
  51. <block class="MagentoFrameworkViewElementTextListText" name="order_item_extra_info"/>
  52. </block>
  53.  
  54. <?xml version="1.0"?>
  55. <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">
  56. <body>
  57. <referenceContainer name="left">
  58. <referenceContainer name="payment_additional_info">
  59. <block class="IbnabOrderAdBlockAdminhtmlOrderViewView" name="sales_order_view_ad" template="order/view/ad.phtml"/>
  60. </referenceContainer>
  61. </referenceContainer>
  62. </body>
  63. </page>
  64.  
  65. <p></p>
  66. <h1>Our Adiitional Block </h1>
  67.  
  68. <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  69. <body>
  70. <referenceBlock name="order_info">
  71. <action method="setTemplate">
  72. <argument name="template" translate="true" xsi:type="string">MD_Demo::order/view/info.phtml</argument>
  73. </action>
  74. </referenceBlock>
  75. </body>
  76. </page>
  77.  
  78. <?php $_order = $block->getOrder() ?>
  79. <?php
  80. $orderAdminDate = $block->formatDate(
  81. $block->getOrderAdminDate($_order->getCreatedAt()),
  82. IntlDateFormatter::MEDIUM,
  83. true
  84. );
  85. $orderStoreDate = $block->formatDate(
  86. $_order->getCreatedAt(),
  87. IntlDateFormatter::MEDIUM,
  88. true,
  89. $block->getTimezoneForStore($_order->getStore())
  90. );
  91. ?>
  92. <section class="admin__page-section order-view-account-information">
  93. <div class="admin__page-section-title">
  94. <span class="title"><?php /* @escapeNotVerified */ echo __('Order & Account Information') ?></span>
  95. </div>
  96. <div class="admin__page-section-content">
  97. <div class="admin__page-section-item order-information">
  98. <?php /* Order Information */?>
  99. <?php if ($_order->getEmailSent()):
  100. $_email = __('The order confirmation email was sent');
  101. else:
  102. $_email = __('The order confirmation email is not sent');
  103. endif; ?>
  104. <div class="admin__page-section-item-title">
  105. <span class="title">
  106. <?php if ($block->getNoUseOrderLink()): ?>
  107. <?php /* @escapeNotVerified */ echo __('Order # %1', $_order->getRealOrderId()) ?> (<span><?php /* @escapeNotVerified */ echo $_email ?></span>)
  108. <?php else: ?>
  109. <a href="<?php /* @escapeNotVerified */ echo $block->getViewUrl($_order->getId()) ?>"><?php /* @escapeNotVerified */ echo __('Order # %1', $_order->getRealOrderId()) ?></a>
  110. <span>(<?php /* @escapeNotVerified */ echo $_email ?>)</span>
  111. <?php endif; ?>
  112. </span>
  113. </div>
  114. <div class="admin__page-section-item-content">
  115. <table class="admin__table-secondary order-information-table">
  116. <tr>
  117. <th><?php /* @escapeNotVerified */ echo __('Order Date') ?></th>
  118. <td><?php /* @escapeNotVerified */ echo $orderAdminDate ?></td>
  119. </tr>
  120. <?php if ($orderAdminDate != $orderStoreDate):?>
  121. <tr>
  122. <th><?php /* @escapeNotVerified */ echo __(
  123. 'Order Date (%1)',
  124. $block->getTimezoneForStore($_order->getStore())
  125. ) ?></th>
  126. <td><?php /* @escapeNotVerified */ echo $orderStoreDate ?></td>
  127. </tr>
  128. <?php endif;?>
  129. <tr>
  130. <th><?php /* @escapeNotVerified */ echo __('Order Status') ?></th>
  131. <td><span id="order_status"><?php /* @escapeNotVerified */ echo $_order->getStatusLabel() ?></span></td>
  132. </tr>
  133. <?php echo $block->getChildHtml(); ?>
  134. <?php if ($block->isSingleStoreMode() == false):?>
  135. <tr>
  136. <th><?php /* @escapeNotVerified */ echo __('Purchased From') ?></th>
  137. <td><?php /* @escapeNotVerified */ echo $block->getOrderStoreName() ?></td>
  138. </tr>
  139. <?php endif; ?>
  140. <?php if ($_order->getRelationChildId()): ?>
  141. <tr>
  142. <th><?php /* @escapeNotVerified */ echo __('Link to the New Order') ?></th>
  143. <td><a href="<?php /* @escapeNotVerified */ echo $block->getViewUrl($_order->getRelationChildId()) ?>">
  144. <?php /* @escapeNotVerified */ echo $_order->getRelationChildRealId() ?>
  145. </a></td>
  146. </tr>
  147. <?php endif; ?>
  148. <?php if ($_order->getRelationParentId()): ?>
  149. <tr>
  150. <th><?php /* @escapeNotVerified */ echo __('Link to the Previous Order') ?></th>
  151. <td><a href="<?php /* @escapeNotVerified */ echo $block->getViewUrl($_order->getRelationParentId()) ?>">
  152. <?php /* @escapeNotVerified */ echo $_order->getRelationParentRealId() ?>
  153. </a></td>
  154. </tr>
  155. <?php endif; ?>
  156. <?php if ($_order->getRemoteIp() && $block->shouldDisplayCustomerIp()): ?>
  157. <tr>
  158. <th><?php /* @escapeNotVerified */ echo __('Placed from IP') ?></th>
  159. <td><?php /* @escapeNotVerified */ echo $_order->getRemoteIp(); echo($_order->getXForwardedFor()) ? ' (' . $block->escapeHtml($_order->getXForwardedFor()) . ')' : ''; ?></td>
  160. </tr>
  161. <?php endif; ?>
  162. <?php if ($_order->getGlobalCurrencyCode() != $_order->getBaseCurrencyCode()): ?>
  163. <tr>
  164. <th><?php /* @escapeNotVerified */ echo __('%1 / %2 rate:', $_order->getGlobalCurrencyCode(), $_order->getBaseCurrencyCode()) ?></th>
  165. <td><?php /* @escapeNotVerified */ echo $_order->getBaseToGlobalRate() ?></td>
  166. </tr>
  167. <?php endif; ?>
  168. <?php if ($_order->getBaseCurrencyCode() != $_order->getOrderCurrencyCode()): ?>
  169. <tr>
  170. <th><?php /* @escapeNotVerified */ echo __('%1 / %2 rate:', $_order->getOrderCurrencyCode(), $_order->getBaseCurrencyCode()) ?></th>
  171. <th><?php /* @escapeNotVerified */ echo $_order->getBaseToOrderRate() ?></th>
  172. </tr>
  173. <?php endif; ?>
  174. </table>
  175. </div>
  176. </div>
  177. <div class="admin__page-section-item order-account-information">
  178. <?php /* Account Information */?>
  179. <div class="admin__page-section-item-title">
  180. <span class="title"><?php /* @escapeNotVerified */ echo __('Account Information') ?></span>
  181. <div class="actions"><?php /* @escapeNotVerified */ echo $block->getAccountEditLink()?></div>
  182. </div>
  183. <div class="admin__page-section-item-content">
  184. <table class="admin__table-secondary order-account-information-table">
  185. <tr>
  186. <th><?php /* @escapeNotVerified */ echo __('Customer Name') ?></th>
  187. <td>
  188. <?php if ($_customerUrl = $block->getCustomerViewUrl()) : ?>
  189. <a href="<?php /* @escapeNotVerified */ echo $_customerUrl ?>" target="_blank">
  190. <span><?php echo $block->escapeHtml($_order->getCustomerName()) ?></span>
  191. </a>
  192. <?php else: ?>
  193. <?php echo $block->escapeHtml($_order->getCustomerName()) ?>
  194. <?php endif; ?>
  195. </td>
  196. </tr>
  197. <tr>
  198. <th><?php /* @escapeNotVerified */ echo __('Email') ?></th>
  199. <td><a href="mailto:<?php echo $block->escapeHtml($_order->getCustomerEmail()) ?>"><?php echo $block->escapeHtml($_order->getCustomerEmail()) ?></a></td>
  200. </tr>
  201. <?php if ($_groupName = $block->getCustomerGroupName()) : ?>
  202. <tr>
  203. <th><?php /* @escapeNotVerified */ echo __('Customer Group') ?></th>
  204. <td><?php /* @escapeNotVerified */ echo $_groupName ?></td>
  205. </tr>
  206. <?php endif; ?>
  207. <?php foreach ($block->getCustomerAccountData() as $data):?>
  208. <tr>
  209. <th><?php /* @escapeNotVerified */ echo $data['label'] ?></th>
  210. <td><?php /* @escapeNotVerified */ echo $data['value'] ?></td>
  211. </tr>
  212. <?php endforeach;?>
  213. </table>
  214. </div>
  215. </div>
  216. </div>
  217. </section>
  218. <section class="admin__page-section order-addresses">
  219. <div class="admin__page-section-title">
  220. <span class="title"><?php /* @escapeNotVerified */ echo __('Address Information') ?></span>
  221. </div>
  222. <div class="admin__page-section-content">
  223. <div class="admin__page-section-item order-billing-address">
  224. <?php /* Billing Address */?>
  225. <div class="admin__page-section-item-title">
  226. <span class="title"><?php /* @escapeNotVerified */ echo __('Billing Address') ?></span>
  227. <div class="actions"><?php /* @escapeNotVerified */ echo $block->getAddressEditLink($_order->getBillingAddress()); ?></div>
  228. </div>
  229. <address class="admin__page-section-item-content"><?php /* @escapeNotVerified */ echo $block->getFormattedAddress($_order->getBillingAddress()); ?></address>
  230. </div>
  231. <?php if (!$block->getOrder()->getIsVirtual()): ?>
  232. <div class="admin__page-section-item order-shipping-address">
  233. <?php /* Shipping Address */ ?>
  234. <div class="admin__page-section-item-title">
  235. <span class="title"><?php /* @escapeNotVerified */ echo __('Shipping Address') ?></span>
  236. <div class="actions"><?php /* @escapeNotVerified */ echo $block->getAddressEditLink($_order->getShippingAddress()); ?></div>
  237. </div>
  238. <address class="admin__page-section-item-content"><?php /* @escapeNotVerified */ echo $block->getFormattedAddress($_order->getShippingAddress()); ?></address>
  239. </div>
  240. <?php endif; ?>
  241. </div>
  242. </section>
  243. <section>
  244. <H1>HERE IS IT MY BLOCK<H1>
  245.  
  246. </section>
  247.  
  248. <?xml version="1.0"?>
  249. <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">
  250. <body>
  251. <referenceContainer name="content">
  252. <block class="TccShippingBlockAdminhtmlOrderViewCustom" name="sales_order_view_custom" template="order/view/custom.phtml"/>
  253. </referenceContainer>
  254. </body>
  255. </page>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement