Substitution.php 932 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Payment\Block\Info;
  7. /**
  8. * Substitution payment info
  9. */
  10. class Substitution extends \Magento\Payment\Block\Info
  11. {
  12. /**
  13. * Add additional info block
  14. *
  15. * @return $this
  16. */
  17. protected function _beforeToHtml()
  18. {
  19. $parentBlock = $this->getParentBlock();
  20. if (!$parentBlock) {
  21. return $this;
  22. }
  23. $container = $parentBlock->getParentBlock();
  24. if ($container) {
  25. $block = $this->_layout->createBlock(
  26. \Magento\Framework\View\Element\Template::class,
  27. '',
  28. ['data' => ['method' => $this->getMethod(), 'template' => 'Magento_Payment::info/substitution.phtml']]
  29. );
  30. $container->setChild('order_payment_additional', $block);
  31. }
  32. return $this;
  33. }
  34. }