@@ -190,8 +190,8 @@ public function getRegionJson()
190190 \Magento \Framework \Profiler::start ('TEST: ' . __METHOD__ , ['group ' => 'TEST ' , 'method ' => __METHOD__ ]);
191191 if (!$ this ->_regionJson ) {
192192 $ scope = $ this ->getCurrentScope ();
193- $ scopeKey = $ scope ['value ' ] ? '_ ' . implode ('_ ' , $ scope ) : null ;
194- $ cacheKey = 'DIRECTORY_REGIONS_JSON_STORE ' . $ scopeKey ;
193+ $ scopeKey = $ scope ['value ' ] ? '_ ' . implode ('_ ' , $ scope ) : '' ;
194+ $ cacheKey = 'DIRECTORY_REGIONS_JSON ' . $ scopeKey ;
195195 $ json = $ this ->_configCacheType ->load ($ cacheKey );
196196 if (empty ($ json )) {
197197 $ regions = $ this ->getRegionData ();
@@ -406,14 +406,21 @@ public function getWeightUnit()
406406 * Get current scope from request
407407 *
408408 * @return array
409+ * @throws \Magento\Framework\Exception\NoSuchEntityException
409410 */
410411 private function getCurrentScope (): array
411412 {
412- $ scope = [
413- 'type ' => ScopeConfigInterface::SCOPE_TYPE_DEFAULT ,
414- 'value ' => null ,
415- ];
413+ $ scope = $ this ->_storeManager ->getStore ()
414+ ? [
415+ 'type ' => ScopeInterface::SCOPE_STORE ,
416+ 'value ' => $ this ->_storeManager ->getStore ()->getId (),
417+ ]
418+ : [
419+ 'type ' => ScopeConfigInterface::SCOPE_TYPE_DEFAULT ,
420+ 'value ' => null ,
421+ ];
416422 $ request = $ this ->_getRequest ();
423+
417424 if ($ request ->getParam (ScopeInterface::SCOPE_WEBSITE )) {
418425 $ scope = [
419426 'type ' => ScopeInterface::SCOPE_WEBSITE ,
0 commit comments