{"id":20601174,"url":"https://github.com/cleverage/cleveragesyliuscolissimoplugin","last_synced_at":"2026-03-01T03:31:59.015Z","repository":{"id":49789950,"uuid":"517996682","full_name":"cleverage/CleverAgeSyliusColissimoPlugin","owner":"cleverage","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-28T14:34:09.000Z","size":110,"stargazers_count":5,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T13:37:22.163Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cleverage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-26T09:30:14.000Z","updated_at":"2022-11-28T17:28:02.000Z","dependencies_parsed_at":"2022-08-12T20:40:23.925Z","dependency_job_id":null,"html_url":"https://github.com/cleverage/CleverAgeSyliusColissimoPlugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FCleverAgeSyliusColissimoPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FCleverAgeSyliusColissimoPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FCleverAgeSyliusColissimoPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FCleverAgeSyliusColissimoPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cleverage","download_url":"https://codeload.github.com/cleverage/CleverAgeSyliusColissimoPlugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248990058,"owners_count":21194688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T09:08:54.274Z","updated_at":"2026-03-01T03:31:58.968Z","avatar_url":"https://github.com/cleverage.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CleverAge/SyliusColissimoPlugin\n\n[![Latest Version][ico-version]](https://packagist.org/packages/cleverage/sylius-colissimo-plugin) \n[![Software License][ico-license]](LICENSE)\n\n## Introduction\n\nThis sylius plugin allows you to manage parcel shipments with colissimo.\nYou can define delivery methods such as `colissimo pickup points` or `colissimo home delivery`. \n\nFor pickup point deliveries, an interactive map with the list of pickup points is generated according to the delivery address entered the tunnel by the user.\n\n## Usage\n\nTODO add screenshots\n\n## Installation\n\n### Step 1: Install and enable plugin\n\nOpen a command console, enter your project directory and execute the following command to download the latest stable version of this plugin:\n\n```bash\n$ composer require cleverage/sylius-colissimo-plugin\n```\n\nThis command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the Composer documentation.\n\nAdd bundle to your `config/bundles.php`:\n\n```php\n\u003c?php\n# config/bundles.php\n\nreturn [\n    // ...\n    CleverAge\\SyliusColissimoPlugin\\CleverAgeSyliusColissimoPlugin::class =\u003e ['all' =\u003e true],\n    // ...\n];\n```\n\n### Step 2: Import routing and configs\n\n#### Import routing\n\n````yaml\n# config/routes/clerverage_sylius_colissimo.yaml\nclever_age_sylius_colissimo_shop:\n  resource: \"@CleverAgeSyliusColissimoPlugin/Resources/config/shop_routing.yml\"\n\nclever_age_sylius_colissimo_admin:\n  resource: \"@CleverAgeSyliusColissimoPlugin/Resources/config/admin_routing.yml\"\n  prefix: /admin\n````\n\n#### Import application config\n\n````yaml\n# config/packages/_sylius.yaml\nimports:\n  - { resource: \"@CleverAgeSyliusColissimoPlugin/Resources/config/config.yaml\" }\n````\n\n### Step 3: Update templates\n\n#### Admin section\n\nAdd the following to the admin template `SyliusAdminBundle/ShippingMethod/_form.html.twig`\n\n```twig\n\u003ch4 class=\"ui dividing header\"\u003e{{ 'clever_age.admin.ui.shipping_method.title'|trans }}\u003c/h4\u003e\n{{ form_row(form.colissimoPickup) }}\n{{ form_row(form.colissimoHomeDelivery) }}\n```\n\nSee an example [here](tests/Application/templates/bundles/SyliusAdminBundle/ShippingMethod/_form.html.twig).\n\nNext add the following to the admin template `SyliusAdminBundle/Order/Show/_shipment.html.twig`\nafter shipment header:\n\n```twig\n{% include \"CleverAgeSyliusColissimoPlugin/Shipment/Label/pickupPoint.html.twig\" %}\n```\n\nSee an example [here](tests/Application/templates/bundles/SyliusAdminBundle/Order/Show/_shipment.html.twig).\n\n#### Shop section\n\nAdd the following to the shop template `SyliusShopBundle/Checkout/SelectShipping/_choice.html.twig`\n\n```twig\n// ...\n{% if method.isColissimoPickup %}\n    {% include '@CleverAgeSyliusColissimoPlugin/Shipment/selectedPickupPoint.html.twig' %}\n{% endif %}\n// ...\n{% if method.isColissimoPickup %}\n    {% include '@CleverAgeSyliusColissimoPlugin/Shipment/map.html.twig' with {\n        'pickupPoints': [myPickupPoints]\n    } %}\n{% endif %}\n```\n\nSee an example [here](tests/Application/templates/bundles/SyliusShopBundle/Checkout/SelectShipping/_choice.html.twig).\n\nNext add the following to the shop template `SyliusShopBundle/Common/Order/_shipments.html.twig`\nafter shipment method header:\n\n```twig\n{% include \"@CleverAgeSyliusColissimoPlugin/Shipment/Label/pickupPoint.html.twig\" %}\n```\n\nSee an example [here](tests/Application/templates/bundles/SyliusShopBundle/Common/Order/_shipments.html.twig).\n\n## Step 4 : Update styles, scripts and install assets\n\nAdd the following to the shop template `SyliusShopBundle/_styles.html.twig`\n\n```twig\n{% include '@SyliusUi/_stylesheets.html.twig' with { 'path': 'bundles/cleveragesyliuscolissimoplugin/css/map.css' } %}\n{% include '@SyliusUi/_stylesheets.html.twig' with { 'path': 'bundles/cleveragesyliuscolissimoplugin/css/popup.css' } %}\n\n{# Important for the map ! #}\n\u003clink rel=\"stylesheet\" href=\"https://unpkg.com/leaflet@1.8.0/dist/leaflet.css\"\n      integrity=\"sha512-hoalWLoI8r4UszCkZ5kL8vayOGVae1oxXe/2A4AO6J9+580uKHDO3JdHb7NzwwzK5xr/Fs0W40kiNHxM9vyTtQ==\"\n      crossorigin=\"\"\n/\u003e\n```\n\nSee an example [here](tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig).\n\nNext the following to the shop template `SyliusShopBundle/_scripts.html.twig`\n\n```twig\n\u003cscript src=\"{{ asset('bundles/cleveragesyliuscolissimoplugin/js/map.js') }}\" type=\"module\"\u003e\u003c/script\u003e\n{% include '@SyliusUi/_javascripts.html.twig' with { 'path': 'bundles/cleveragesyliuscolissimoplugin/js/select-pickup-point.js' } %}\n{% include '@SyliusUi/_javascripts.html.twig' with { 'path': 'bundles/cleveragesyliuscolissimoplugin/js/change-pickup-point.js' } %}\n{% include '@SyliusUi/_javascripts.html.twig' with { 'path': 'bundles/cleveragesyliuscolissimoplugin/js/select-shipping.js' } %}\n```\n\nSee an example [here](tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig).\n\n### Install assets\n\n```bash\nbin/console assets:install --symlink\n```\n\n# Step 5 : Customize resources\n\n**Shipping method resource**\n\nIf you haven't extended the shipping method resource yet, here is what it should look like :\n\n```php\n\u003c?php\n// src/Entity/ShippingMethod.php\n\ndeclare(strict_types=1);\n\nnamespace App\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\nuse CleverAge\\SyliusColissimoPlugin\\Model\\ShippingMethodInterface;\nuse CleverAge\\SyliusColissimoPlugin\\Model\\ShippingMethodTrait;\nuse Sylius\\Component\\Core\\Model\\ShippingMethod as BaseShippingMethod;\n\n/**\n * @ORM\\Entity()\n * @ORM\\Table(name=\"sylius_shipping_method\")\n */\nclass ShippingMethod extends BaseShippingMethod implements ShippingMethodInterface\n{\n    use ShippingMethodTrait;\n}\n\n```\n\n**Order resource**\n\nIf you haven't extended the order resource yet, here is what it should look like :\n\n```php\n\u003c?php\n// src/Entity/Order.php\n\ndeclare(strict_types=1);\n\nnamespace App\\Entity;\n\nuse CleverAge\\SyliusColissimoPlugin\\Model\\OrderInterface;\nuse CleverAge\\SyliusColissimoPlugin\\Model\\OrderTrait;\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Sylius\\Component\\Core\\Model\\Order as BaseOrder;\n\n/**\n * @ORM\\Entity()\n * @ORM\\Table(name=\"sylius_order\")\n */\nclass Order extends BaseOrder implements OrderInterface\n{\n    use OrderTrait;\n}\n```\n\nYou can read about extending resources [here](https://docs.sylius.com/en/latest/customization/model.html).\n\n**Update shipping and order resources config**\n\nNext you need to tell Sylius that you will use your own extended resources :\n\n```yaml\n# config/packages/_sylius.yaml\n\nsylius_shipping:\n  resources:\n    shipping_method:\n      classes:\n        model: App\\Entity\\ShippingMethod\n\nsylius_order:\n  resources:\n    order:\n      classes:\n        model: App\\Entity\\Order\n```\n\n# Step 6 : Update database schema \n\n```bash\nbin/console doctrine:migrations:diff\nbin/console doctrine:migrations:migrate \n```\n\n# Step 7 : Configure plugin\n\n```yaml\n// config/packages/cleverage_sylius_colissimo.yaml\n\nclever_age_sylius_colissimo:\n  encryptionKey: 'your encryption key'\n```\n\nEnjoy now ! \n\n[ico-version]: https://poser.pugx.org/cleverage/sylius-colissimo-plugin/v/stable\n[ico-license]: https://poser.pugx.org/cleverage/sylius-colissimo-plugin/license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleverage%2Fcleveragesyliuscolissimoplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleverage%2Fcleveragesyliuscolissimoplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleverage%2Fcleveragesyliuscolissimoplugin/lists"}