bestit / ct-order-export-bundle
Symfony 3 Bundle to export commercetools orders based on templates and a virtual file system.
Requires
- php: ^7.0
- commercetools/php-sdk: ^1.6
- oneup/flysystem-bundle: ^1.10
- symfony/monolog-bundle: ^3.0
- symfony/symfony: ^3.2
- symfony/twig-bundle: ^3.2
Requires (Dev)
- phpunit/phpunit: 5.5
- squizlabs/php_codesniffer: ^2.8
This package is not auto-updated.
Last update: 2024-11-23 21:15:22 UTC
README
Symfony 3 Bundle to export commercetools orders based on templates and a virtual file system.
Installation
An example implementation can be found in bestit/commercetools-order-export.
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require bestit/ct-order-export-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new \Oneup\FlysystemBundle\OneupFlysystemBundle(), new \BestIt\CtOrderExportBundle\BestItCtOrderExportBundle() ); // ... } // ... }
Step 3: Configuration of the bundle
best_it_ct_order_export: commercetools_client: # Required id: ~ # Required secret: ~ # Required project: ~ # Required scope: ~ # Required # Please provide the service id for your flysystem file system. filesystem: ~ # Required # Please provide the service id for your logging service. logger: logger orders: # Should we use a paginated list of orders (or is the result list changing by "itself")? with_pagination: true # Add where clauses for orders: https://dev.commercetools.com/http-api-projects-orders.html#query-orders default_where: [] # Which template is used for the export of a single order? file_template: detail.xml.twig # Provide an order field name or a format string for the date function enclosed with {{ and }}. name_scheme: 'order_{{id}}_{{YmdHis}}.xml'
Use the bundle
Shell-Command
The bundle provides you with a shell command:
$ php bin/console order-export:export-orders [-v|-vv|-vv] [-q]
Events
This bundle provides two events at this moment:
- order_export.preOrderExport: This event is triggered with an BestIt\CtOrderExportBundle\Event\PrepareOrderExportEvent-Instance. Use the API for the exportData to get more exportable data.
- order_export.postOrderExport: The event instance of type BestIt\CtOrderExportBundle\Event\FinishOrderExportEvent allows you to manpulate an order after the export.
Further Todos
- Unittesting
- Added a list template
- Make heavier use of events