Skip to content
Snippets Groups Projects
Commit 9f8be4c4 authored by Leonid Poluyanov's avatar Leonid Poluyanov
Browse files

MAGETWO-84448: Product Import does not allow store-specific Custom Option labels

parent f38aec0b
Branches
No related merge requests found
......@@ -126,6 +126,15 @@ class RowCustomizer implements RowCustomizerInterface
*/
private $storeManager;
/**
* @param StoreManagerInterface $storeManager
* @throws \RuntimeException
*/
public function __construct(StoreManagerInterface $storeManager = null)
{
$this->storeManager = $storeManager ?: ObjectManager::getInstance()->get(StoreManagerInterface::class);
}
/**
* Retrieve list of bundle specific columns
* @return array
......@@ -475,22 +484,8 @@ class RowCustomizer implements RowCustomizerInterface
private function getStoreCodeById($storeId)
{
if (!isset($this->storeIdToCode[$storeId])) {
$this->storeIdToCode[$storeId] = $this->getStoreManager()->getStore($storeId)->getCode();
$this->storeIdToCode[$storeId] = $this->storeManager->getStore($storeId)->getCode();
}
return $this->storeIdToCode[$storeId];
}
/**
* Initialize StoreManagerInterface if it was not and return it.
*
* @return StoreManagerInterface
* @throws \RuntimeException
*/
private function getStoreManager()
{
if (!$this->storeManager) {
$this->storeManager = ObjectManager::getInstance()->get(StoreManagerInterface::class);
}
return $this->storeManager;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment