Shipping.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Checkout cart shipping block plugin
  8. *
  9. * @author Magento Core Team <core@magentocommerce.com>
  10. */
  11. namespace Magento\OfflineShipping\Model\Plugin\Checkout\Block\Cart;
  12. class Shipping
  13. {
  14. /**
  15. * @var \Magento\Framework\App\Config\ScopeConfigInterface
  16. */
  17. protected $_scopeConfig;
  18. /**
  19. * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  20. */
  21. public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)
  22. {
  23. $this->_scopeConfig = $scopeConfig;
  24. }
  25. /**
  26. * @param \Magento\Checkout\Block\Cart\LayoutProcessor $subject
  27. * @param bool $result
  28. * @return bool
  29. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  30. */
  31. public function afterIsStateActive(\Magento\Checkout\Block\Cart\LayoutProcessor $subject, $result)
  32. {
  33. return (bool)$result || (bool)$this->_scopeConfig->getValue(
  34. 'carriers/tablerate/active',
  35. \Magento\Store\Model\ScopeInterface::SCOPE_STORE
  36. );
  37. }
  38. }