Created
September 2, 2015 05:41
-
-
Save birchestx/3a26a61347cbe485677f to your computer and use it in GitHub Desktop.
Mage::getStoreConfig in Magento 2 compared to Magento 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Magento 1.x: | |
Mage::getStoreConfig('carriers/shipper/active') | |
Magento 2.x: | |
protected $scopeConfig; | |
public function __construct( | |
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig | |
) { | |
$this->scopeConfig = $scopeConfig; | |
} | |
Then can do - | |
$this->_scopeConfig->getValue( | |
'carriers/shipper/active', | |
\Magento\Store\Model\ScopeInterface::SCOPE_STORE); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I forked your gist and added markdown markup, makes the whole a little more readable 😉
https://gist.github.com/timneutkens/17185b139e8476ec7296c92142d03028