Info.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Block\Adminhtml\Order\View\Tab;
  7. /**
  8. * Order information tab
  9. *
  10. * @api
  11. * @author Magento Core Team <core@magentocommerce.com>
  12. * @since 100.0.2
  13. */
  14. class Info extends \Magento\Sales\Block\Adminhtml\Order\AbstractOrder implements
  15. \Magento\Backend\Block\Widget\Tab\TabInterface
  16. {
  17. /**
  18. * Retrieve order model instance
  19. *
  20. * @return \Magento\Sales\Model\Order
  21. */
  22. public function getOrder()
  23. {
  24. return $this->_coreRegistry->registry('current_order');
  25. }
  26. /**
  27. * Retrieve source model instance
  28. *
  29. * @return \Magento\Sales\Model\Order
  30. */
  31. public function getSource()
  32. {
  33. return $this->getOrder();
  34. }
  35. /**
  36. * Retrieve order totals block settings
  37. *
  38. * @return array
  39. */
  40. public function getOrderTotalData()
  41. {
  42. return [
  43. 'can_display_total_due' => true,
  44. 'can_display_total_paid' => true,
  45. 'can_display_total_refunded' => true
  46. ];
  47. }
  48. /**
  49. * Get order info data
  50. *
  51. * @return array
  52. */
  53. public function getOrderInfoData()
  54. {
  55. return ['no_use_order_link' => true];
  56. }
  57. /**
  58. * Get tracking html
  59. *
  60. * @return string
  61. */
  62. public function getTrackingHtml()
  63. {
  64. return $this->getChildHtml('order_tracking');
  65. }
  66. /**
  67. * Get items html
  68. *
  69. * @return string
  70. */
  71. public function getItemsHtml()
  72. {
  73. return $this->getChildHtml('order_items');
  74. }
  75. /**
  76. * Retrieve gift options container block html
  77. *
  78. * @return string
  79. */
  80. public function getGiftOptionsHtml()
  81. {
  82. return $this->getChildHtml('gift_options');
  83. }
  84. /**
  85. * Get payment html
  86. *
  87. * @return string
  88. */
  89. public function getPaymentHtml()
  90. {
  91. return $this->getChildHtml('order_payment');
  92. }
  93. /**
  94. * View URL getter
  95. *
  96. * @param int $orderId
  97. * @return string
  98. */
  99. public function getViewUrl($orderId)
  100. {
  101. return $this->getUrl('sales/*/*', ['order_id' => $orderId]);
  102. }
  103. /**
  104. * ######################## TAB settings #################################
  105. */
  106. /**
  107. * {@inheritdoc}
  108. */
  109. public function getTabLabel()
  110. {
  111. return __('Information');
  112. }
  113. /**
  114. * {@inheritdoc}
  115. */
  116. public function getTabTitle()
  117. {
  118. return __('Order Information');
  119. }
  120. /**
  121. * {@inheritdoc}
  122. */
  123. public function canShowTab()
  124. {
  125. return true;
  126. }
  127. /**
  128. * {@inheritdoc}
  129. */
  130. public function isHidden()
  131. {
  132. return false;
  133. }
  134. }