/** * {@inheritdoc} */ public function install(array $productFixtures, array $galleryFixtures, array $downloadableFixtures = []) { foreach ($downloadableFixtures as $fileName) { $fileName = $this->fixtureManager->getFixture($fileName); if (!file_exists($fileName)) { continue; } $rows = $this->csvReader->getData($fileName); $header = array_shift($rows); foreach ($rows as $row) { $data = []; foreach ($row as $key => $value) { $data[$header[$key]] = $value; } $row = $data; $sku = $row['product_sku']; if (!isset($this->downloadableData[$sku])) { $this->downloadableData[$sku] = []; } $this->downloadableData[$sku] = $this->converter->getDownloadableData($row, $this->downloadableData[$sku]); $this->downloadableData[$sku]['sample'] = $this->converter->getSamplesInfo(); } } parent::install($productFixtures, $galleryFixtures); }
/** * {@inheritdoc} */ public function install() { $this->attributeSetup->install(['Magento_CatalogSampleData::fixtures/attributes.csv']); $this->categorySetup->install(['Magento_CatalogSampleData::fixtures/categories.csv']); $this->productSetup->install(['Magento_CatalogSampleData::fixtures/SimpleProduct/products_gear_bags.csv', 'Magento_CatalogSampleData::fixtures/SimpleProduct/products_gear_fitness_equipment.csv', 'Magento_CatalogSampleData::fixtures/SimpleProduct/products_gear_fitness_equipment_ball.csv', 'Magento_CatalogSampleData::fixtures/SimpleProduct/products_gear_fitness_equipment_strap.csv', 'Magento_CatalogSampleData::fixtures/SimpleProduct/products_gear_watches.csv'], ['Magento_CatalogSampleData::fixtures/SimpleProduct/images_gear_bags.csv', 'Magento_CatalogSampleData::fixtures/SimpleProduct/images_gear_fitness_equipment.csv', 'Magento_CatalogSampleData::fixtures/SimpleProduct/images_gear_watches.csv']); }