Skip to content

Commit 25de51b

Browse files
author
Sergii Kovalenko
committed
MAGETWO-56941: [Github] Allowed countries for customer address in admin using storeview configuration #2946
1 parent 79d2f46 commit 25de51b

File tree

1 file changed

+5
-4
lines changed
  • app/code/Magento/Customer/Model/ResourceModel/Address/Attribute/Source

1 file changed

+5
-4
lines changed

app/code/Magento/Customer/Model/ResourceModel/Address/Attribute/Source/Country.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Magento\Checkout\Model\Session;
1515
use Magento\Framework\App\ObjectManager;
16+
use Magento\Store\Api\StoreResolverInterface;
1617
use Magento\Store\Model\StoreManagerInterface;
1718

1819
/**
@@ -49,7 +50,7 @@ public function getAllOptions()
4950
{
5051
if (!$this->_options) {
5152
$this->_options = $this->_createCountriesCollection()->loadByStore(
52-
$this->getStoreManager()->getStore()->getId()
53+
$this->getStoreResolver()->getCurrentStoreId()
5354
)->toOptionArray();
5455
}
5556
return $this->_options;
@@ -65,10 +66,10 @@ protected function _createCountriesCollection()
6566

6667
/**
6768
* @deprecated
68-
* @return StoreManagerInterface
69+
* @return StoreResolverInterface
6970
*/
70-
private function getStoreManager()
71+
private function getStoreResolver()
7172
{
72-
return ObjectManager::getInstance()->get(StoreManagerInterface::class);
73+
return ObjectManager::getInstance()->get(StoreResolverInterface::class);
7374
}
7475
}

0 commit comments

Comments
 (0)