WeeeSettings.php 1021 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Weee\Plugin\Ui\DataProvider;
  7. use Magento\Framework\App\Config;
  8. /**
  9. * Provide param on front, which says the current set of weee settings
  10. */
  11. class WeeeSettings
  12. {
  13. /**
  14. * @var Config
  15. */
  16. private $config;
  17. /**
  18. * WeeeSettings constructor.
  19. * @param Config $config
  20. */
  21. public function __construct(Config $config)
  22. {
  23. $this->config = $config;
  24. }
  25. /**
  26. * Add weee data to result
  27. *
  28. * @param \Magento\Checkout\CustomerData\Cart $subject
  29. * @param array $result
  30. * @return array
  31. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  32. */
  33. public function afterGetData(\Magento\Catalog\Ui\DataProvider\Product\Listing\DataProvider $subject, $result)
  34. {
  35. $result['displayWeee'] = $this->config
  36. ->getValue(\Magento\Weee\Model\Config::XML_PATH_FPT_DISPLAY_PRODUCT_LIST);
  37. return $result;
  38. }
  39. }