ItemsBox.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\GiftMessage\Block\Message\Multishipping\Plugin;
  7. use Magento\Multishipping\Block\Checkout\Shipping as ShippingBlock;
  8. use Magento\GiftMessage\Helper\Message as MessageHelper;
  9. use Magento\Framework\DataObject;
  10. /**
  11. * Multishipping items box plugin
  12. */
  13. class ItemsBox
  14. {
  15. /**
  16. * Gift message helper
  17. *
  18. * @var MessageHelper
  19. */
  20. protected $helper;
  21. /**
  22. * Construct
  23. *
  24. * @param MessageHelper $helper
  25. */
  26. public function __construct(MessageHelper $helper)
  27. {
  28. $this->helper = $helper;
  29. }
  30. /**
  31. * Get items box message text for multishipping
  32. *
  33. * @param ShippingBlock $subject
  34. * @param string $itemsBoxText
  35. * @param DataObject $addressEntity
  36. *
  37. * @return string
  38. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  39. */
  40. public function afterGetItemsBoxTextAfter(ShippingBlock $subject, $itemsBoxText, DataObject $addressEntity)
  41. {
  42. return $itemsBoxText . $this->helper->getInline('multishipping_address', $addressEntity);
  43. }
  44. }