Info.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Multishipping checkout payment information data
  8. *
  9. * @author Magento Core Team <core@magentocommerce.com>
  10. */
  11. namespace Magento\Multishipping\Block\Checkout\Payment;
  12. /**
  13. * @api
  14. * @since 100.0.2
  15. */
  16. class Info extends \Magento\Payment\Block\Info\AbstractContainer
  17. {
  18. /**
  19. * @var \Magento\Multishipping\Model\Checkout\Type\Multishipping
  20. */
  21. protected $_multishipping;
  22. /**
  23. * @param \Magento\Framework\View\Element\Template\Context $context
  24. * @param \Magento\Payment\Helper\Data $paymentData
  25. * @param \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping
  26. * @param array $data
  27. */
  28. public function __construct(
  29. \Magento\Framework\View\Element\Template\Context $context,
  30. \Magento\Payment\Helper\Data $paymentData,
  31. \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping,
  32. array $data = []
  33. ) {
  34. $this->_multishipping = $multishipping;
  35. parent::__construct($context, $paymentData, $data);
  36. }
  37. /**
  38. * Retrieve payment info model
  39. *
  40. * @return \Magento\Payment\Model\Info
  41. */
  42. public function getPaymentInfo()
  43. {
  44. return $this->_multishipping->getQuote()->getPayment();
  45. }
  46. /**
  47. * @return string
  48. */
  49. protected function _toHtml()
  50. {
  51. $html = '';
  52. $block = $this->getChildBlock($this->_getInfoBlockName());
  53. if ($block) {
  54. $html = $block->toHtml();
  55. }
  56. return $html;
  57. }
  58. }