Skip to content

Commit c7a1adf

Browse files
author
Alexey Yakimovich
committed
MAGETWO-87974: Can't hide product images via hide_from_product_page attribute during import
- Removed show_on_product_page field form export/import;
1 parent 5968811 commit c7a1adf

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,6 @@ protected function setHeaderColumns($customOptionsData, $stockItemRows)
734734
'additional_images',
735735
'additional_image_labels',
736736
'hide_from_product_page',
737-
'show_on_product_page',
738737
'custom_options'
739738
]
740739
);
@@ -1199,16 +1198,13 @@ private function appendMultirowData(&$dataRow, $multiRawData)
11991198
$additionalImages = [];
12001199
$additionalImageLabels = [];
12011200
$additionalImageIsDisabled = [];
1202-
$additionalImageIsEnabled = [];
12031201
foreach ($multiRawData['mediaGalery'][$productLinkId] as $mediaItem) {
12041202
if ((int)$mediaItem['_media_store_id'] === Store::DEFAULT_STORE_ID) {
12051203
$additionalImages[] = $mediaItem['_media_image'];
12061204
$additionalImageLabels[] = $mediaItem['_media_label'];
12071205

12081206
if ($mediaItem['_media_is_disabled'] == true) {
12091207
$additionalImageIsDisabled[] = $mediaItem['_media_image'];
1210-
} else {
1211-
$additionalImageIsEnabled[] = $mediaItem['_media_image'];
12121208
}
12131209
}
12141210
}
@@ -1218,8 +1214,6 @@ private function appendMultirowData(&$dataRow, $multiRawData)
12181214
implode(Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalImageLabels);
12191215
$dataRow['hide_from_product_page'] =
12201216
implode(Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalImageIsDisabled);
1221-
$dataRow['show_on_product_page'] =
1222-
implode(Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalImageIsEnabled);
12231217
$multiRawData['mediaGalery'][$productLinkId] = [];
12241218
}
12251219
foreach ($this->_linkTypeProvider->getLinkTypes() as $linkTypeName => $linkId) {
@@ -1253,8 +1247,6 @@ private function appendMultirowData(&$dataRow, $multiRawData)
12531247
if ((int)$mediaItem['_media_store_id'] === $storeId) {
12541248
if ($mediaItem['_media_is_disabled'] == true) {
12551249
$additionalImageIsDisabled[] = $mediaItem['_media_image'];
1256-
} else {
1257-
$additionalImageIsEnabled[] = $mediaItem['_media_image'];
12581250
}
12591251
}
12601252
}
@@ -1263,10 +1255,6 @@ private function appendMultirowData(&$dataRow, $multiRawData)
12631255
$dataRow['hide_from_product_page'] =
12641256
implode(Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalImageIsDisabled);
12651257
}
1266-
if ($additionalImageIsEnabled) {
1267-
$dataRow['show_on_product_page'] =
1268-
implode(Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalImageIsEnabled);
1269-
}
12701258
}
12711259

12721260
if (!empty($this->collectedMultiselectsData[$storeId][$productId])) {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
312312
self::COL_MEDIA_IMAGE => 'additional_images',
313313
'_media_image_label' => 'additional_image_labels',
314314
'_media_is_disabled' => 'hide_from_product_page',
315-
'_media_is_enabled' => 'show_on_product_page',
316315
Product::COL_STORE => 'store_view_code',
317316
Product::COL_ATTR_SET => 'attribute_set_code',
318317
Product::COL_TYPE => 'product_type',
@@ -1945,8 +1944,7 @@ private function getImagesHiddenStates($rowData)
19451944
{
19461945
$statesArray = [];
19471946
$mappingArray = [
1948-
'_media_is_disabled' => '1',
1949-
'_media_is_enabled' => '0'
1947+
'_media_is_disabled' => '1'
19501948
];
19511949

19521950
foreach ($mappingArray as $key => $value) {

0 commit comments

Comments
 (0)