Akeneo - Integration

Add Middleware Process console command to ConsoleDependencyProvider in your project:


	…
	use SprykerMiddleware\Zed\Process\Communication\Console\ProcessConsole;
	…
	protected function getConsoleCommands(Container $container)
	{
		$commands = [
			… 
			new ProcessConsole(),
		];
		…
		return $commands;
	}
				

Add Process Module on project level and specify configuration profiles:


	class ProcessDependencyProvider extends SprykerMiddlewareProcessDependencyProvider
	{
		…
		protected function getConfigurationProfilePluginsStack(): array
		{
			$profileStack = parent::getConfigurationProfilePluginsStack();
			$profileStack[] = new AkeneoPimConfigurationProfilePlugin();
			$profileStack[] = new DefaultConfigurationProfilePlugin();
 
			return $profileStack;
		}
	}
				

Lastly, you should implement data import plugins for writing data (categories, attributes, abstract and concrete products) into the shop. You need to add AkeneoPimMiddlewareConnector module on project level and provide corresponding data import plugins in the following methods of AkeneoPimMiddlewareConnectorDependencyProvider:


	class AkeneoPimMiddlewareConnectorDependencyProvider extends SprykerEcoAkeneoPimMiddlewareConnectorDependencyProvider
	{
		...
		/**
		* @param \Spryker\Zed\Kernel\Container $container
		*
		* @return \Spryker\Zed\Kernel\Container
		*/
		protected function addCategoryDataImporterPlugin(Container $container): Container
		{
			$container[static::AKENEO_PIM_MIDDLEWARE_CATEGORY_IMPORTER_PLUGIN] = function () {
				return new CategoryDataImporterPlugin();
			};
 
			return $container;
	}
 
	/**
	* @param \Spryker\Zed\Kernel\Container $container
	*
	* @return \Spryker\Zed\Kernel\Container
	*/
	protected function addAttributeDataImporterPlugin(Container $container): Container
	{
		$container[static::AKENEO_PIM_MIDDLEWARE_ATTRIBUTE_IMPORTER_PLUGIN] = function () {
			return new AttributeDataImporterPlugin();
		};
 
		return $container;
	}
 
	/**
	* @param \Spryker\Zed\Kernel\Container $container
	*
	* @return \Spryker\Zed\Kernel\Container
	*/
	protected function addProductAbstractDataImporterPlugin(Container $container): Container
	{
		$container[static::AKENEO_PIM_MIDDLEWARE_PRODUCT_ABSTRACT_IMPORTER_PLUGIN] = function () {
			return new ProductAbstractDataImporterPlugin();
		};
 
		return $container;
	}
 
	/**
	* @param \Spryker\Zed\Kernel\Container $container
	*
	* @return \Spryker\Zed\Kernel\Container
	*/
	protected function addProductConcreteDataImporterPlugin(Container $container): Container
	{
		$container[static::AKENEO_PIM_MIDDLEWARE_PRODUCT_CONCRETE_IMPORTER_PLUGIN] = function () {
			return new ProductConcreteDataImporterPlugin();
		};
 
		return $container;
		}
	}
				

Commands

Now the following console commands are available in your project:


	1) Command to prepare locale mapping:
	vendor/bin/console middleware:process:run -p LOCALE_MAP_IMPORT_PROCESS -o data/import/maps/locale_map.json
 
	2) Command to prepare products attributes mapping:
	vendor/bin/console middleware:process:run -p ATTRIBUTE_MAP_PROCESS -o data/import/maps/attribute_map.json
 
	3) Command to import categories:
	vendor/bin/console middleware:process:run -p DEFAULT_CATEGORY_IMPORT_PROCESS
 
	4) Command to import super attributes:
	vendor/bin/console middleware:process:run -p SUPER_ATTRIBUTE_IMPORT_PROCESS -o data/import/maps/super_attribute_map.json
 
	5) Command to import products attributes:
	vendor/bin/console middleware:process:run -p ATTRIBUTE_IMPORT_PROCESS
 
	6) Command to prepare product models data in local file:
	vendor/bin/console middleware:process:run -p PRODUCT_MODEL_PREPARATION_PROCESS -o data/import/maps/product_models.json
 
	7) Command to import product model data (abstract products):
	vendor/bin/console middleware:process:run -p DEFAULT_PRODUCT_MODEL_IMPORT_PROCESS -i data/import/maps/product_models.json
 
	8) Command to prepare products data in local file:
	vendor/bin/console middleware:process:run -p PRODUCT_PREPARATION_PROCESS -o data/import/maps/products.json
 
	9) Command to import product model data (abstract products):
	vendor/bin/console middleware:process:run -p DEFAULT_PRODUCT_IMPORT_PROCESS -i data/import/maps/products.json
				

 

See also:

 

Last review date: Jul. 24th, 2018