Skip to content

Commit

Permalink
Merge pull request #285 from magento-falcons/MAGETWO-57201
Browse files Browse the repository at this point in the history
[Falcons] Bug fixes
  • Loading branch information
Yaroslav Onischenko authored Aug 26, 2016
2 parents 2c4b7f0 + 7eef535 commit 9a4a7eb
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 93 deletions.
8 changes: 8 additions & 0 deletions app/code/Magento/CatalogImportExport/Model/Export/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,14 @@ protected function getCustomOptionsData($productIds)
$row['max_characters'] = $option['max_characters'];
}

foreach (['file_extension', 'image_size_x', 'image_size_y'] as $fileOptionKey) {
if (!isset($option[$fileOptionKey])) {
continue;
}

$row[$fileOptionKey] = $option[$fileOptionKey];
}

$values = $option->getValues();

if ($values) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class Option extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
'radio' => true,
'checkbox' => true,
'multiple' => true,
'file' => ['sku', 'file_extension', 'image_size_x', 'image_size_y'],
];

/**
Expand Down Expand Up @@ -1136,6 +1137,28 @@ private function processOptionRow($name, $optionRow)
$result[$this->columnMaxCharacters] = $optionRow['max_characters'];
}

$result = $this->addFileOptions($result, $optionRow);

return $result;
}

/**
* Add file options
*
* @param array $result
* @param array $optionRow
* @return array
*/
private function addFileOptions($result, $optionRow)
{
foreach (['file_extension', 'image_size_x', 'image_size_y'] as $fileOptionKey) {
if (!isset($optionRow[$fileOptionKey])) {
continue;
}

$result[self::COLUMN_PREFIX . $fileOptionKey] = $optionRow[$fileOptionKey];
}

return $result;
}

Expand Down
118 changes: 59 additions & 59 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9a4a7eb

Please sign in to comment.