Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function run()
 {
     $this->attributeSetup->run();
     $this->categorySetup->run();
     $this->productSetup->run();
     $this->postInstaller->addSetupResource($this->productLinkSetup);
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function run()
 {
     if (!$this->deployHelper->isMediaPresent()) {
         $this->logger->log('Sample Data Media was not installed. Skipping downloadable product installation');
         return;
     }
     $this->gallery->setFixtures(['Downloadable/images_products_training_video.csv']);
     $downloadableFiles = ['Downloadable/downloadable_data_training_video_download.csv'];
     foreach ($downloadableFiles as $downloadableFile) {
         $downloadableFileName = $this->fixtureHelper->getPath($downloadableFile);
         $csvDownloadableReader = $this->csvReaderFactory->create(['fileName' => $downloadableFileName, 'mode' => 'r']);
         foreach ($csvDownloadableReader as $downloadableRow) {
             $sku = $downloadableRow['product_sku'];
             if (!isset($this->downloadableData[$sku])) {
                 $this->downloadableData[$sku] = [];
             }
             $this->downloadableData[$sku] = $this->converter->getDownloadableData($downloadableRow, $this->downloadableData[$sku]);
             $this->downloadableData[$sku]['sample'] = $this->converter->getSamplesInfo();
         }
     }
     parent::run();
 }
 /**
  * @param \Magento\Catalog\Model\ProductFactory $productFactory
  * @param \Magento\Catalog\Model\Config $catalogConfig
  * @param Product\Converter $converter
  * @param FixtureHelper $fixtureHelper
  * @param CsvReaderFactory $csvReaderFactory
  * @param Gallery $gallery
  * @param \Magento\SampleData\Model\Logger $logger
  * @param \Magento\SampleData\Helper\StoreManager $storeManager
  * @param array $fixtures
  * @codingStandardsIgnoreStart
  */
 public function __construct(\Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Catalog\Model\Config $catalogConfig, Product\Converter $converter, FixtureHelper $fixtureHelper, CsvReaderFactory $csvReaderFactory, Gallery $gallery, \Magento\SampleData\Model\Logger $logger, \Magento\SampleData\Helper\StoreManager $storeManager, $fixtures = ['GiftCard/products_giftcard.csv'])
 {
     $gallery->setFixtures(['GiftCard/images_giftcard.csv']);
     parent::__construct($productFactory, $catalogConfig, $converter, $fixtureHelper, $csvReaderFactory, $gallery, $logger, $storeManager, $fixtures);
 }
Exemple #4
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     parent::run();
     $this->eavConfig->clear();
 }