Skip to content

Commit 5ee7e52

Browse files
committed
ACPT-1467: Import downloadable product
1 parent cd28f6c commit 5ee7e52

File tree

3 files changed

+206
-65
lines changed

3 files changed

+206
-65
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ protected function _isReadyForSaving(array &$options, array &$titles, array $typ
11571157
protected function _getMultiRowFormat($rowData)
11581158
{
11591159
if (is_array($rowData['custom_options'])) {
1160-
$rowData = $this->parseJsonCustomOptions($rowData);
1160+
$rowData = $this->parseStructuredCustomOptions($rowData);
11611161
} else {
11621162
$rowData = $this->_parseCustomOptions($rowData);
11631163
}
@@ -2089,12 +2089,12 @@ protected function _parseCustomOptions($rowData)
20892089
}
20902090

20912091
/**
2092-
* Parse JSON custom options to inner format.
2092+
* Parse structured custom options to inner format.
20932093
*
20942094
* @param array $rowData
20952095
* @return array
20962096
*/
2097-
private function parseJsonCustomOptions(array $rowData): array
2097+
private function parseStructuredCustomOptions(array $rowData): array
20982098
{
20992099
if (empty($rowData['custom_options'])) {
21002100
return $rowData;

app/code/Magento/DownloadableImportExport/Helper/Data.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
2020
*/
2121
public function isRowDownloadableEmptyOptions(array $rowData)
2222
{
23-
$result = isset($rowData[Downloadable::COL_DOWNLOADABLE_LINKS])
24-
&& $rowData[Downloadable::COL_DOWNLOADABLE_LINKS] == ''
25-
&& isset($rowData[Downloadable::COL_DOWNLOADABLE_SAMPLES])
26-
&& $rowData[Downloadable::COL_DOWNLOADABLE_SAMPLES] == '';
27-
return $result;
23+
$links = $rowData[Downloadable::COL_DOWNLOADABLE_LINKS] ?? '';
24+
$samples = $rowData[Downloadable::COL_DOWNLOADABLE_SAMPLES] ?? '';
25+
26+
return empty($links) && empty($samples);
2827
}
2928

3029
/**

0 commit comments

Comments
 (0)