akeneo-labs/excel-connector-bundle
Installation:
composer require akeneo-labs/excel-connector-bundle:1.6.*
Enable the bundle in AppKernel.php:
new Akeneo\Bundle\SpreadsheetParserBundle\AkeneoSpreadsheetParserBundle(),
new Pim\Bundle\ExcelConnectorBundle\PimExcelConnectorBundle(),
Clear cache and install assets:
php app/console cache:clear --env=prod
php app/console pim:installer:assets --env=prod
First Use Case:
init.xlsx template.Catalog Initialization:
init.xlsx to define:
Families Tab: Family name, code, label
Categories Tab: Category name, code, parent code
Attributes Tab: Attribute code, type, label, default value
Product Import/Export:
sku, name, price, image).Programmatic Usage (Advanced):
Akeneo\Bundle\SpreadsheetParserBundle\Reader service to parse Excel files in custom commands/jobs:
$reader = $this->get('akeneo_spreadsheet_parser.reader');
$data = $reader->read('path/to/file.xlsx');
pim_catalog.repository.product).init.xlsx and PIM configurations.phpoffice/phpexcel (v1.8) and akeneo-labs/spreadsheet-parser-bundle.Excel Compatibility:
.xlsx in Excel before uploading.Channel Mismatches:
web vs. Web) will cause import failures.init.xlsx and PIM channel configurations.Attribute Mapping:
Deprecation:
akeneo/ExcelInitBundle instead.var/log/prod.log for parsing errors (e.g., invalid headers, data types).phpoffice/phpexcel to v1.8 if encountering deprecated function warnings.Custom Parsers:
Akeneo\Bundle\SpreadsheetParserBundle\Reader to handle custom Excel formats:
class CustomReader extends AbstractReader {
public function read($filePath) { ... }
}
services:
custom.reader:
class: AppBundle\Reader\CustomReader
tags: ['akeneo_spreadsheet_parser.reader']
Post-Import Logic:
$eventDispatcher->dispatch('pim_catalog.product_import.post', new ProductImportEvent($product));
Batch Processing:
$jobInstance = $this->get('pim_job_executor.job_instance');
$jobInstance->run('import_product', ['file' => $filePath]);
How can I help you explore Laravel packages today?