Skip to content

This Sylius plugin allows you to import data from Akeneo PIM

License

Notifications You must be signed in to change notification settings

diglin/SyliusAkeneoPlugin

 
 

Repository files navigation

License CI - Analysis CI - Sylius Version Total Downloads

Sylius Akeneo Plugin

This plugin allow you to import data from Akeneo PIM.

Features

Requirements

Version
PHP ^8.0
Sylius ^1.10
Akeneo PIM >=v6.0

Installation

  1. Add the bundle and dependencies in your composer.json :

    composer require synolia/sylius-akeneo-plugin --no-scripts
  2. Enable the plugin in your config/bundles.php file by add

    Synolia\SyliusAkeneoPlugin\SynoliaSyliusAkeneoPlugin::class => ['all' => true],
  3. Import required config in your config/packages/_sylius.yaml file:

    imports:
        - { resource: "@SynoliaSyliusAkeneoPlugin/Resources/config/config.yaml" }
  4. Import routing in your config/routes.yaml file:

    synolia_akeneo:
        resource: "@SynoliaSyliusAkeneoPlugin/Resources/config/routes.yaml"
        prefix: '/%sylius_admin.path_name%'
  5. Add Asset trait to Product.php and ProductVariant.php entities

    <?php
    
    declare(strict_types=1);
    
    namespace App\Entity\Product;
    
    use Doctrine\ORM\Mapping as ORM;
    use Synolia\SyliusAkeneoPlugin\Entity\ProductAssetTrait;
    
    /**
     * @ORM\Entity
     * @ORM\Table(name="sylius_product")
     */
     class Product
     {
         ...
         use ProductAssetTrait {
             __construct as private initializeAssetsCollection;
         }
    
         public function __construct()
         {
             parent::__construct();
    
             $this->initializeAssetsCollection();
         }
         ...
     }
    <?php
    
    declare(strict_types=1);
    
    namespace App\Entity\Product;
    
    use Doctrine\ORM\Mapping as ORM;
    use Synolia\SyliusAkeneoPlugin\Entity\ProductVariantAssetTrait;
    
    /**
     * @ORM\Entity
     * @ORM\Table(name="sylius_product_variant")
     */
     class ProductVariant
     {
         ...
         use ProductVariantAssetTrait {
             __construct as private initializeAssetsCollection;
         }
    
         public function __construct()
         {
             parent::__construct();
    
             $this->initializeAssetsCollection();
         }
         ...
     }
  6. Apply plugin migrations to your database:

    bin/console doctrine:migrations:migrate
  7. Clear cache

    bin/console cache:clear

Development

Akeneo Enterprise Edition

Reference Entity and Asset attribute types

License

This library is under the EUPL-1.2 license.

Credits

Developed by Synolia.

About

This Sylius plugin allows you to import data from Akeneo PIM

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 97.4%
  • Twig 1.7%
  • Other 0.9%