Advanced CSV Connector is an extension of classic Akeneo CSV Connector. It allows to customize columns mapping on import or export.
Made with 💙 by C&M
| Bundle version | Akeneo version |
|---|---|
| v6.0.* | v6.0.* |
| v5.0.* | v5.0.* |
| v1.8.* | v4.0.* |
| v1.7.* | v3.2.* (EE) |
| v1.6.* | v3.1.* / v3.2.* |
| v1.5.* | v3.1.* / v3.2.* |
| v1.4.* | v2.3.* |
| v1.3.* | v2.1.* |
You can use php-lua package to update your values dynamically during import or export.
For LUA scripts available functions and libraries have been limited for security reasons. You can use:
- string
- math
- ipairs
- load
- next
- pairs
- rawequal
- rawgetwget
- rawlen
- rawset
- select
- tonumber
- tostring
- type
This package is not a requirement. A classic PHP method can also be used.
Update your composer.json file to use our fork of Custom entity bundle in repositories node:
"repositories": [
...
{
"type": "vcs",
"url": "https://github.com/ClickAndMortar/CustomEntityBundle"
}
...
],And add our bundle:
$ composer require "clickandmortar/advanced-csv-connector-bundle":"<version-wanted>.*"Example for last version:
$ composer require "clickandmortar/advanced-csv-connector-bundle":"6.0.*"Enable the bundle by adding it to the list of registered bundles
in the config/bundles.php file of your project:
<?php
return [
// ...
Pim\Bundle\CustomEntityBundle\PimCustomEntityBundle::class => ['all' => true],
ClickAndMortar\AdvancedCsvConnectorBundle\ClickAndMortarAdvancedCsvConnectorBundle::class => ['all' => true]
];Update your config/routes/routes.yml file:
pim_customentity:
prefix: /reference-data
resource: "@PimCustomEntityBundle/Resources/config/routing.yml"
candm_advanced_csv_connector:
prefix: /candm-advanced-csv-connector
resource: "@ClickAndMortarAdvancedCsvConnectorBundle/Resources/config/routing.yml"
And finally clear cache and update database:
rm -rf var/cache/*
php bin/console --env=prod pim:installer:assets --symlink --clean
yarn run webpack
php bin/console doctrine:schema:update --force
To create a new import mapping, go to Référenciel / Mappings d'import and click on Create top right button.
You can add as many mapping lines as you want by clicking on Ajouter une ligne.
Some explanations for table columns:
Attribut(mandatory): Attribute code in your Akeneo project (you can use suffixes like-fr_FRor-EURfor locales, channels, currencies, ...)Nom de la colonne(mandatory): Column name in your file to importTransformation: LUA script name or PHP method name to update value after mapping. Example: Uppercase, lowercase, ... (you can create a new LUA script underRéférenciel / Scripts LUA).Valeur par défaut: Default value for attribute if empty data in fileIdentifiant(mandatory): Used to defined main identifier attribute of productUniquement à la création: Set attribute value only if product is new (checked withidentifierattribute)Effacer si null: Remove key from item mapping if value is nullSupprimer: Click on this cell to delete mapping line
Once mapping is saved, go to Imports part and create a new job with type Import des produits avancé (CSV).
After job creation, go to edition mode and update Mapping parameter in global parameters tab.
To create a new export mapping, go to Référenciel / Mappings d'export and click on Create top right button.
You can add as many mapping lines as you want by clicking on Ajouter une ligne.
Some explanations for table columns:
Attribut(mandatory): Attribute code in your Akeneo project (you can use suffixes like-fr_FRor-EURfor locales, channels, currencies, ...)Nom de la colonne(mandatory): Column name in your file to exportValeur forcée: Force a value (erase given attribute value from Akeneo)Transformation: LUA script name or PHP method name to update value after mapping. Example: Uppercase, lowercase, ... (you can create a new LUA script underRéférenciel / Scripts LUA)Utiliser le libellé: Boolean to get the label associated to the code given (for attribute options or custom entities)Langue: Select a specific locale for the label to export (linked toUtiliser le libellécolumn)Longueur max.: Integer use to shorten attribute value if necessaryValeur par défaut: Default value for column if empty attribute valueSupprimer: Click on this cell to delete mapping line
Once mapping is saved, go to Exports part and create a new job with type Export des produits avancé (CSV).
After job creation, go to edition mode and update Mapping parameter in global parameters tab.