Skip to content

Commit 8aa3da1

Browse files
committed
8255: Export Products action doesn't consider hide_for_product_page value.
1 parent 334ef2f commit 8aa3da1

File tree

2 files changed

+12
-27
lines changed

2 files changed

+12
-27
lines changed

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

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ protected function getExportData()
905905
$dataRow = array_merge($dataRow, $stockItemRows[$productId]);
906906
}
907907
$this->appendMultirowData($dataRow, $multirawData);
908-
if ($dataRow && !$this->skipRow($dataRow)) {
908+
if ($dataRow) {
909909
$exportData[] = $dataRow;
910910
}
911911
}
@@ -1169,14 +1169,17 @@ private function appendMultirowData(&$dataRow, $multiRawData)
11691169
$productLinkId = $dataRow['product_link_id'];
11701170
$storeId = $dataRow['store_id'];
11711171
$sku = $dataRow[self::COL_SKU];
1172+
$type = $dataRow[self::COL_TYPE];
1173+
$attributeSet = $dataRow[self::COL_ATTR_SET];
11721174

11731175
unset($dataRow['product_id']);
11741176
unset($dataRow['product_link_id']);
11751177
unset($dataRow['store_id']);
11761178
unset($dataRow[self::COL_SKU]);
1177-
1179+
unset($dataRow[self::COL_STORE]);
1180+
unset($dataRow[self::COL_ATTR_SET]);
1181+
unset($dataRow[self::COL_TYPE]);
11781182
if (Store::DEFAULT_STORE_ID == $storeId) {
1179-
unset($dataRow[self::COL_STORE]);
11801183
$this->updateDataWithCategoryColumns($dataRow, $multiRawData['rowCategories'], $productId);
11811184
if (!empty($multiRawData['rowWebsites'][$productId])) {
11821185
$websiteCodes = [];
@@ -1274,6 +1277,9 @@ private function appendMultirowData(&$dataRow, $multiRawData)
12741277
$dataRow[self::COL_STORE] = $this->_storeIdToCode[$storeId];
12751278
}
12761279
$dataRow[self::COL_SKU] = $sku;
1280+
$dataRow[self::COL_ATTR_SET] = $attributeSet;
1281+
$dataRow[self::COL_TYPE] = $type;
1282+
12771283
return $dataRow;
12781284
}
12791285

@@ -1512,25 +1518,4 @@ protected function getProductEntityLinkField()
15121518
}
15131519
return $this->productEntityLinkField;
15141520
}
1515-
1516-
/**
1517-
* Check if row has valuable information to export.
1518-
*
1519-
* @param array $dataRow
1520-
* @return bool
1521-
*/
1522-
private function skipRow(array $dataRow)
1523-
{
1524-
$baseInfo = [
1525-
self::COL_STORE,
1526-
self::COL_ATTR_SET,
1527-
self::COL_TYPE,
1528-
self::COL_SKU,
1529-
'store_id',
1530-
'product_id',
1531-
'product_link_id',
1532-
];
1533-
1534-
return empty(array_diff(array_keys($dataRow), $baseInfo));
1535-
}
15361521
}

dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_multistore.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
1
2020
)->setAttributeSetId(
2121
4
22-
)->setStoreId(
22+
)->setCustomAttribute(
23+
'tax_class_id',
2324
1
2425
)->setWebsiteIds(
2526
[1]
@@ -42,8 +43,7 @@
4243
)->save();
4344

4445
$product = $objectManager->create(\Magento\Catalog\Model\Product::class);
45-
$product->setStoreId(1)
46-
->load(1)
46+
$product->load(1)
4747
->setStoreId($store->getId())
4848
->setName('StoreTitle')
4949
->save();

0 commit comments

Comments
 (0)