4

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);
2

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';
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.