94 if (!$this->_scopeConfig->getValue(
96 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
97 ) || !$this->_scopeConfig->getValue(
98 self::CRON_STRING_PATH,
99 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
107 $service = $this->_scopeConfig->getValue(
108 self::IMPORT_SERVICE,
109 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
113 $importModel = $this->_importFactory->create(
$service);
114 $rates = $importModel->fetchRates();
115 $errors = $importModel->getMessages();
116 }
catch (\Exception $e) {
117 $importWarnings[] =
__(
'FATAL ERROR:') .
' ' 118 .
__(
"The import model can't be initialized. Verify the model and try again.");
122 $importWarnings[] =
__(
'FATAL ERROR:') .
' ' .
__(
'Please specify the correct Import Service.');
127 $importWarnings[] =
__(
'WARNING:') .
' ' . $error;
131 $errorRecipient = $this->_scopeConfig->getValue(
132 self::XML_PATH_ERROR_RECIPIENT,
133 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
135 if (
sizeof($importWarnings) == 0) {
136 $this->_currencyFactory->create()->saveRates(
$rates);
137 }
elseif ($errorRecipient) {
139 $this->inlineTranslation->suspend();
141 $this->_transportBuilder->setTemplateIdentifier(
142 $this->_scopeConfig->getValue(
143 self::XML_PATH_ERROR_TEMPLATE,
144 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
146 )->setTemplateOptions(
148 'area' => \
Magento\Backend\
App\Area\FrontNameResolver::AREA_CODE,
152 [
'warnings' => join(
"\n", $importWarnings)]
154 $this->_scopeConfig->getValue(
155 self::XML_PATH_ERROR_IDENTITY,
156 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
158 )->addTo($errorRecipient);
159 $transport = $this->_transportBuilder->getTransport();
160 $transport->sendMessage();
162 $this->inlineTranslation->resume();
elseif(isset( $params[ 'redirect_parent']))