{"id":20601185,"url":"https://github.com/cleverage/cleveragesyliusdpdplugin","last_synced_at":"2025-04-15T01:36:21.372Z","repository":{"id":65145298,"uuid":"582681040","full_name":"cleverage/CleverAgeSyliusDpdPlugin","owner":"cleverage","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-23T08:55:30.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-07-12T18:17:57.645Z","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":null,"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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-27T15:06:34.000Z","updated_at":"2023-08-06T09:38:17.000Z","dependencies_parsed_at":"2024-11-16T09:08:59.836Z","dependency_job_id":"933c28e4-2221-48b6-900e-a7dbcbf14836","html_url":"https://github.com/cleverage/CleverAgeSyliusDpdPlugin","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"b552f932019d675eb1cf7cb75bbd1c19cf08fefc"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FCleverAgeSyliusDpdPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FCleverAgeSyliusDpdPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FCleverAgeSyliusDpdPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverage%2FCleverAgeSyliusDpdPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cleverage","download_url":"https://codeload.github.com/cleverage/CleverAgeSyliusDpdPlugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248990057,"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:56.284Z","updated_at":"2025-04-15T01:36:21.352Z","avatar_url":"https://github.com/cleverage.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CleverAge/SyliusDpdPlugin\n\n[![Latest Version][ico-version]](https://packagist.org/packages/cleverage/sylius-dpd-plugin)\n[![Software License][ico-license]](LICENSE)\n\n## Introduction\n\nThis sylius plugin allows you to manage parcel shipments with DPD.\nYou can define `DPD pickup points` delivery method.\n\nFor pickup point deliveries, an interactive map with the list of pickup points is generated according to the delivery\naddress 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\nversion of this plugin:\n\n```bash\n$ composer require cleverage/sylius-dpd-plugin\n```\n\nThis command requires you to have Composer installed globally, as explained in\nthe [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\\SyliusDpdPlugin\\CleverAgeSyliusDpdPlugin::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_dpd.yaml\nclever_age_sylius_dpd_shop:\n  resource: \"@CleverAgeSyliusDpdPlugin/Resources/config/shop_routing.yml\"\n````\n\n#### Import application config\n\n````yaml\n# config/packages/_sylius.yaml\nimports:\n  - { resource: \"@CleverAgeSyliusDpdPlugin/Resources/config/config.yaml\" }\n````\n\n### Step 3: Update templates\n\n#### Admin section\n\nAdd the following to the admin template `SyliusAdminBundle/Order/Show/_shipment.html.twig`\nafter shipment header:\n\n```twig\n{% include \"CleverAgeSyliusDpdPlugin/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.isDpdPickup %}\n    {% include '@CleverAgeSyliusDpdPlugin/Shipment/selectedPickupPoint.html.twig' %}\n{% endif %}\n// ...\n{% if method.isDpdPickup %}\n    {% include '@CleverAgeSyliusDpdPlugin/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 \"@CleverAgeSyliusDpdPlugin/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/cleveragesyliusdpdplugin/css/dpd-map.css' } %}\n{% include '@SyliusUi/_stylesheets.html.twig' with { 'path': 'bundles/cleveragesyliusdpdplugin/css/dpd-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/cleveragesyliusdpsplugin/js/dpd-map.js') }}\" type=\"module\"\u003e\u003c/script\u003e\n    {% include '@SyliusUi/_javascripts.html.twig' with { 'path': 'bundles/cleveragesyliusdpdplugin/js/dpd-select-shipping.js' } %}\n\n    {% include '@SyliusUi/_javascripts.html.twig' with { 'path': 'bundles/cleveragesyliusdpdplugin/js/dpd-select-pickup-point.js' } %}\n    {% include '@SyliusUi/_javascripts.html.twig' with { 'path': 'bundles/cleveragesyliusdpdplugin/js/dpd-change-pickup-point.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\\SyliusDpdPlugin\\Contract\\DpdShippingMethodInterface;\nuse CleverAge\\SyliusDpdPlugin\\Entity\\Traits\\DpdShippingMethodTrait;\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 DpdShippingMethodInterface\n{\n    use DpdShippingMethodTrait;\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\\SyliusDpdPlugin\\Entity\\Traits\\DpdOrderTrait;\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\n{\n    use DpdOrderTrait;\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_dpd.yaml\n\nclever_age_sylius_dpd:\n  securityKey: 'security key'\n```\n\nEnjoy now !\n\n[ico-version]: https://poser.pugx.org/cleverage/sylius-dpd-plugin/v/stable\n\n[ico-license]: https://poser.pugx.org/cleverage/sylius-dpd-plugin/license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleverage%2Fcleveragesyliusdpdplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleverage%2Fcleveragesyliusdpdplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleverage%2Fcleveragesyliusdpdplugin/lists"}