Question

I have recently gone through magento's core ScopeInterface file which is located in Magento\Store\Model.

enter image description here

My question is why magento define SCOPE_STORES & SCOPE_STORE similar as WEBSITE and for GROUP.

Whenever i want to get data with scopeConfig how can i get (means if i want website data then SCOPE_WEBSITE or SCOPE_WEBSITES, which constant i have to use) ?

$this->scopeConfig->getValue(self::XML_PATH_PRODUCT_MAX_QTY,ScopeInterface::SCOPE_WEBSITES);
Was it helpful?

Solution

They do the same thing, if you check the following class:

Magento\Framework\App\Config::getValue()

The following code is pretty self-explanatory:

if ($scope === 'store') {
    $scope = 'stores';
} elseif ($scope === 'website') {
    $scope = 'websites';
}
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top