Econda - Exporting CSVs

To implement Econda plugin you should be familiar with the concept of extending Spryker and plugins.

Zed Output Folder

We need to define the output folder where the generated CSV files will be saved. This is done by adding a line in your config.

config [EcondaConstants::CSV_FOLDER_PATH] = APPLICATION_ROOT_DIR . '' ;

The application must have proper access(es) depending on what you expect to achieve.

Console

To export the products and categories, we must register the Collectors that were created in the Console. Econda module has already everything in place and the only thing you need to do is to add CollectorFileExportConsole to Pyz\Zed\Console\ConsoleDependencyProvider like in the snippet bellow:

<?php
use SprykerEco\Zed\Econda\Communication\Console\EcondaFileExportConsole;
...
	/**
	* @param \Spryker\Zed\Kernel\Container $container
	*
	* @return \Symfony\Component\Console\Command\Command[] */
	public function getConsoleCommands(Container $container)
	{

	$commands = [

		// ...
		new EcondaFileExportConsole(),
		];
	}

Checking Your Setup

If all the steps are followed correctly, you should be able to see the econda:file:export command in Econda section when you run vendor/bin/console from the project's root folder.

Running vendor/bin/console econda:file:export will create several CSV files in the folder you have specified in $config[EcondaConstants::ECONDA_CSV_FOLDER_PATH].

 

See also:

 

Last review date: Dec 13th, 2018