Skip to content

Commit

Permalink
Removed default value for new connector (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
fritsjustbetter committed Jul 2, 2024
1 parent ef3966d commit b7c821a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
8 changes: 0 additions & 8 deletions Helper/Import/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ protected function getColumnsFromResult(array $result, array $keys = []): array
return $mappedResult;
}

$adminChannel = $this->scopeConfig->getValue('akeneo_connector/akeneo_api/admin_channel');

$defaultLanguage = $this->scopeConfig->getValue('akeneo_connector/justbetter/defaultlanguage');

$requiredAttributes = $this->getRequiredAttributes();

foreach ($requiredAttributes as $requiredAttribute) {
Expand All @@ -32,10 +28,6 @@ protected function getColumnsFromResult(array $result, array $keys = []): array
continue;
}

if (!array_key_exists($requiredAttribute.'-'.$defaultLanguage.'-'.$adminChannel, $mappedResult) && $defaultLanguage) {
$mappedResult[$requiredAttribute.'-'.$defaultLanguage.'-'.$adminChannel] = $this->getFirstValue($result['values'][$requiredAttribute]);
}

$mappedResult[$requiredAttribute] = $this->getFirstValue($result['values'][$requiredAttribute]);
}

Expand Down
9 changes: 0 additions & 9 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,6 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Set the value on the default store for required attributes that are scopable or localizable. (Default no)</comment>
</field>
<field id="defaultlanguage" translate="label" type="text" sortOrder="155" showInDefault="1" showInWebsite="0"
showInStore="0">
<label>Default language for admin channel</label>
<comment>If a value of the admin channel is missing, then this setting can be used to map a certain value as your definitive fallback value for a required attribute for example 'nl_NL'
</comment>
<depends>
<field id="akeneo_connector/justbetter/defaultstorevalues">1</field>
</depends>
</field>
<group id="slack" translate="label" type="text" sortOrder="160" showInDefault="1" showInWebsite="0"
showInStore="0">
<label>Slack Akeneo import notifications</label>
Expand Down

0 comments on commit b7c821a

Please sign in to comment.