-
Notifications
You must be signed in to change notification settings - Fork 2
01 Install
- PHP
^8.0
- Sylius
^1.11
- Akeneo PIM CE or EE
>= 3.2
. The requirement for the version3.2
is because the provided implementation of the product importer relies on thefamily_variant
key in the Akeneo GET Product model API response.
-
Run
composer require webgriffe/sylius-akeneo-plugin
. -
Add the plugin to the
config/bundles.php
file:Webgriffe\SyliusAkeneoPlugin\WebgriffeSyliusAkeneoPlugin::class => ['all' => true],
-
Import the plugin config by creating a file in
config/packages/webgriffe_sylius_akeneo_plugin.yaml
with the following contents:imports: - { resource: "@WebgriffeSyliusAkeneoPlugin/Resources/config/config.yaml" }
-
Import the plugin routes by creating a file in
config/routes/webgriffe_sylius_akeneo_plugin.yaml
with the follwing content:webgriffe_sylius_akeneo_plugin_admin: resource: "@WebgriffeSyliusAkeneoPlugin/Resources/config/admin_routing.yaml" prefix: /admin
-
Finish the installation by updating the database schema and installing assets:
bin/console doctrine:migrations:diff bin/console doctrine:migrations:migrate bin/console assets:install bin/console sylius:theme:assets:install
-
Optional. If you want you can also add the Schedule Akeneo PIM import 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_enqueue', {'productId': product.id }) }}" > <i class="icon cloud download"></i> {{ 'webgriffe_sylius_akeneo.ui.enqueue'|trans }} </a>
-
Optional (usually only on production or pre-production environments). Install the suggested crontab.
First of all you must configure your Akeneo API connection parameters. Edit the config/packages/webgriffe_sylius_akeneo_plugin.yaml
file by adding the following content:
# ...
webgriffe_sylius_akeneo:
api_client:
# These values are from the official Akeneo PIM demo, replace with yours.
base_url: 'http://demo.akeneo.com/'
username: 'admin'
password: 'admin'
client_id: '1_demo_client_id'
secret: 'demo_secret'
Pay attention that among these parameters there are some sensitive configuration that you probably don't want to commit in your VCS. There are different solutions to this problem, like env configurations and secrets. Refer to Symfony best practices doc for more info.
Developed by Webgriffe®.