Skip to content

Commit 8ed3eea

Browse files
MAGETWO-53569: [Github] Import custom options type 'file' fails #4035
1 parent a7bcac3 commit 8ed3eea

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

app/code/Magento/CatalogImportExport/Model/Export/Product.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,14 @@ protected function getCustomOptionsData($productIds)
12631263
$row['max_characters'] = $option['max_characters'];
12641264
}
12651265

1266+
foreach (['file_extension', 'image_size_x', 'image_size_y'] as $fileOptionKey) {
1267+
if (!isset($option[$fileOptionKey])) {
1268+
continue;
1269+
}
1270+
1271+
$row[$fileOptionKey] = $option[$fileOptionKey];
1272+
}
1273+
12661274
$values = $option->getValues();
12671275

12681276
if ($values) {

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class Option extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
105105
'radio' => true,
106106
'checkbox' => true,
107107
'multiple' => true,
108+
'file' => ['sku', 'file_extension', 'image_size_x', 'image_size_y'],
108109
];
109110

110111
/**
@@ -1136,6 +1137,14 @@ private function processOptionRow($name, $optionRow)
11361137
$result[$this->columnMaxCharacters] = $optionRow['max_characters'];
11371138
}
11381139

1140+
foreach (['file_extension', 'image_size_x', 'image_size_y'] as $fileOptionKey) {
1141+
if (!isset($optionRow[$fileOptionKey])) {
1142+
continue;
1143+
}
1144+
1145+
$result[self::COLUMN_PREFIX . $fileOptionKey] = $optionRow[$fileOptionKey];
1146+
}
1147+
11391148
return $result;
11401149
}
11411150

0 commit comments

Comments
 (0)