Installation
- Run
composer require webgriffe/sylius-akeneo-plugin akeneo/api-php-client -
Add
Webgriffe\SyliusAkeneoPlugin\WebgriffeSyliusAkeneoPlugin::class => ['all' => true]to yourconfig/bundles.php. - Add basic plugin configuration by creating the
config/packages/webgriffe_sylius_akeneo_plugin.yamlfile with the following content:imports: - { resource: "@WebgriffeSyliusAkeneoPlugin/config/config.yaml" } - Import the routes needed for the plugin by adding the following to your
config/routes.yamlfile:webgriffe_sylius_akeneo_plugin_admin: resource: "@WebgriffeSyliusAkeneoPlugin/config/admin_routing.yaml" prefix: '/%sylius_admin.path_name%' - If you use
Doctrineyou should run a diff of your Doctrine’s schema and then run the migration generated:bin/console doctrine:migrations:diff bin/console doctrine:migrations:migrate - Finish the installation by installing assets:
bin/console assets:install bin/console sylius:theme:assets:install - Optional. If you want you can also add the Import from Akeneo PIM button in the product’s detail and edit page. Override Sylius template by create a new file in the folder:
templates/bundles/SyliusAdminBundle/Product/_showInShopButton.html.twig. Copy the content from the original Sylius file and paste it in the new file. Finally, add the button to the bottom of the file.# ... <a class="ui labeled icon button violet" href="{{ path('webgriffe_sylius_akeneo_product_import', {'productId': product.id }) }}"> <i class="icon cloud download"></i> {{ 'webgriffe_sylius_akeneo.ui.import'|trans }} </a> - Optional (usually only on production or pre-production environments). Install the suggested crontab.