3brs / sylius-ppl-parcelshops-plugin
PPL parcelshops plugin for Sylius
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:sylius-plugin
pkg:composer/3brs/sylius-ppl-parcelshops-plugin
Requires
- php: ^8.1
- 3brs/sylius-shipment-export-plugin: ^0.8.0
- sylius/sylius: ^1.13.0
Requires (Dev)
- behat/behat: ^3.9.0
- behat/mink-selenium2-driver: ^1.4
- dbrekelmans/bdi: ^1.4
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- doctrine/annotations: ^2.0
- friends-of-behat/mink: ^1.10
- friends-of-behat/mink-browserkit-driver: ^1.6.2
- friends-of-behat/mink-debug-extension: ^2.1
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- php-http/message-factory: ^1.0.0
- phpstan/phpstan: ^1.12
- phpstan/phpstan-doctrine: ^1.5.7
- phpstan/phpstan-strict-rules: ^1.3.0
- phpstan/phpstan-symfony: ^1.3
- phpstan/phpstan-webmozart-assert: ^1.2.0
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- rector/rector: ^1.2
- robertfausk/behat-panther-extension: ^1.2
- robertfausk/mink-panther-driver: ^1.1.2
- slevomat/coding-standard: ^7.0.15
- sylius-labs/coding-standard: ^4.2
- symfony/browser-kit: ^6.4
- symfony/debug-bundle: ^6.4
- symfony/dotenv: ^6.4
- symfony/flex: ^2.2.2
- symfony/framework-bundle: ^6.4
- symfony/http-foundation: ^6.4
- symfony/http-kernel: ^6.4
- symfony/intl: ^6.4
- symfony/panther: ^2.3
- symfony/web-profiler-bundle: ^6.4
- symplify/easy-coding-standard: ^10.3.0
Conflicts
- api-platform/core: <2.7.13
- babdev/pagerfanta-bundle: <3.6.1
- doctrine/collections: <1.7.0
- doctrine/data-fixtures: <1.5.1
- doctrine/dbal: <2.13.3
- doctrine/doctrine-bundle: <2.4.2
- friendsofsymfony/rest-bundle: <3.1.0
- jms/serializer-bundle: <4.2.0
- knplabs/knp-menu: <3.3.0
- lexik/jwt-authentication-bundle: <2.12
- masterminds/html5: <2.7.5
- polishsymfonycommunity/symfony-mocker-container: <1.0.6
- sylius/resource-bundle: <1.11.0
- symfony/css-selector: <4.4.24
- symfony/framework-bundle: >=5.4.0 <=5.4.20|>=6.0.0 <=6.0.16|>=6.1.0 <=6.1.8|>=6.2.0 <=6.2.2|6.2.8
- symfony/mime: <5.4.0
- symfony/web-link: <5.3.0
- twig/twig: <2.14.7
- webmozart/assert: <1.11.0
- willdurand/negotiation: <3.0
This package is auto-updated.
Last update: 2025-12-09 14:38:49 UTC
README
PPL parcelshop plugin
Features
- Enables sending shipments via PPL to PPL parcelshops.
- The user can choose the PPL parcelshops from the map during checkout in the Shipment step

- See PPL parcelshop in final checkout step and also in the admin panel.
- Export CSV with the PPL parcelshops shipments and import it easily into PPL's system.
PPL CSV import configuration
- Configure CSV structure in your client zone https://klient.ppl.cz
Installation
1. Install the plugin via Composer
composer require 3brs/sylius-ppl-parcelshops-plugin
2. Register the bundles
Add plugin classes to your config/bundles.php:
return [ // ... ThreeBRS\SyliusShipmentExportPlugin\ThreeBRSSyliusShipmentExportPlugin::class => ['all' => true], ThreeBRS\SyliusPplParcelshopsPlugin\ThreeBRSSyliusPplParcelshopsPlugin::class => ['all' => true], ];
3. Import routing
Add routing to config/routes.yaml:
threebrs_sylius_shipment_export_plugin: resource: "@ThreeBRSSyliusShipmentExportPlugin/Resources/config/routing.yaml" prefix: '/%sylius_admin.path_name%' threebrs_sylius_ppl_parcelshops_plugin: resource: '@ThreeBRSSyliusPplParcelshopsPlugin/Resources/config/routing.yaml' prefix: /
4. Import plugin configuration
Add config import to config/packages/_sylius.yaml:
imports: # ... - { resource: "@ThreeBRSSyliusPplParcelshopsPlugin/Resources/config/config.yaml" }
5. Configure entity models
Your Entity Shipment has to implement \ThreeBRS\SyliusPplParcelshopsPlugin\Model\PplShipmentInterface.
You can use the trait \ThreeBRS\SyliusPplParcelshopsPlugin\Model\PplShipmentTrait.
Example:
<?php namespace App\Entity\Shipping; use Doctrine\ORM\Mapping as ORM; use Sylius\Component\Core\Model\Shipment as BaseShipment; use ThreeBRS\SyliusPplParcelshopsPlugin\Model\PplShipmentInterface; use ThreeBRS\SyliusPplParcelshopsPlugin\Model\PplShipmentTrait; #[ORM\Entity] #[ORM\Table(name: 'sylius_shipment')] class Shipment extends BaseShipment implements PplShipmentInterface { use PplShipmentTrait; }
Your Entity ShippingMethod has to implement \ThreeBRS\SyliusPplParcelshopsPlugin\Model\PplShippingMethodInterface.
You can use the trait \ThreeBRS\SyliusPplParcelshopsPlugin\Model\PplShippingMethodTrait.
Example:
<?php namespace App\Entity\Shipping; use Doctrine\ORM\Mapping as ORM; use Sylius\Component\Core\Model\ShippingMethod as BaseShippingMethod; use ThreeBRS\SyliusPplParcelshopsPlugin\Model\PplShippingMethodInterface; use ThreeBRS\SyliusPplParcelshopsPlugin\Model\PplShippingMethodTrait; #[ORM\Entity] #[ORM\Table(name: 'sylius_shipping_method')] class ShippingMethod extends BaseShippingMethod implements PplShippingMethodInterface { use PplShippingMethodTrait; }
For more details on entity customization, see Sylius docs - Customizing Models.
6. Override templates
Admin Shipping Method Form
Override templates/bundles/SyliusAdminBundle/ShippingMethod/_form.html.twig and include the PPL form:
{# @SyliusAdmin/ShippingMethod/_form.html.twig #} {# ... existing form content ... #} {{ include('@ThreeBRSSyliusPplParcelshopsPlugin/Admin/ShippingMethod/_pplForm.html.twig') }} {# ... rest of the form ... #}
- see
tests/Application/templates/bundles/SyliusAdminBundle/ShippingMethod/_form.html.twigfor example
Shop Checkout Shipping Choice
Override templates/bundles/SyliusShopBundle/Checkout/SelectShipping/_choice.html.twig and include the PPL widget at the end:
{# @SyliusShop/Checkout/SelectShipping/_choice.html #} {# ... existing shipping choice content ... #} {{ include('@ThreeBRSSyliusPplParcelshopsPlugin/Shop/Checkout/SelectShipping/_pplChoice.html.twig') }}
- see
tests/Application/templates/bundles/SyliusShopBundle/Checkout/SelectShipping/_choice.html.twigfor example
Shop Order Addresses
Override templates/bundles/SyliusShopBundle/Common/Order/_addresses.html.twig and replace the shipping address section:
{# @SyliusAdmin/Order/Show/_addresses.html.twig #} <div class="ui segment"> <div class="ui two column divided stackable grid"> <div class="column" id="sylius-billing-address" {{ sylius_test_html_attribute('billing-address') }}> <div class="ui small dividing header">{{ 'sylius.ui.billing_address'|trans }}</div> {% include '@SyliusShop/Common/_address.html.twig' with {'address': order.billingAddress} %} </div> <div class="column" id="sylius-shipping-address" {{ sylius_test_html_attribute('shipping-address') }}> <div class="ui small dividing header">{{ 'sylius.ui.shipping_address'|trans }}</div> {{ include('@ThreeBRSSyliusPplParcelshopsPlugin/Shop/Common/Order/_addresses.html.twig') }} </div> </div> </div>
Admin Order Addresses
Override templates/bundles/SyliusAdminBundle/Order/Show/_addresses.html.twig and replace the shipping address section:
{# @ThreeBRSShipmentExportPlugin/_row.html.twig #} {% if order.shippingAddress is not null %} <h4 class="ui top attached styled header"> {{ 'sylius.ui.shipping_address'|trans }} </h4> <div class="ui attached segment" id="shipping-address"> {{ include('@ThreeBRSSyliusPplParcelshopsPlugin/Admin/Common/Order/_addresses.html.twig') }} </div> {% endif %} {# ... billing address and other content ... #}
7. Create and run database migrations
Generate and run doctrine migrations to add the required database columns:
bin/console doctrine:migrations:diff bin/console doctrine:migrations:migrate
Configuration
The plugin can be configured using the following parameters in your config/packages/_sylius.yaml or config/services.yaml:
parameters: # Shipping method codes that should be exported to PPL CSV format # Default: ['ppl_parcel_shop'] # IMPORTANT: Only shipments using shipping methods with these codes will be exported threebrs_sylius_ppl_parcelshops_plugin_ppl_shipping_method_codes: ['ppl_parcel_shop', 'your_custom_ppl_method'] # Country codes where PPL parcelshop service is available # Default: ['CZ', 'SK', 'DE', 'PL', 'HU', 'BG', 'RO', 'NL', 'AT'] threebrs_sylius_ppl_parcelshops_plugin_ppl_countries: ['CZ', 'SK', 'DE', 'PL', 'HU', 'BG', 'RO', 'NL', 'AT']
Note: The threebrs_sylius_ppl_parcelshops_plugin_ppl_shipping_method_codes parameter determines which shipments will appear in the export list. Make sure your shipping method code matches one of the codes in this array, otherwise the shipments won't be available for export.
Usage
1. Create a PPL Parcelshop Shipping Method
- Go to the admin panel: Shipping Methods → Create
- Fill in the basic information:
- Code: Use
ppl_parcel_shop(default) or a custom code that matches thethreebrs_sylius_ppl_parcelshops_plugin_ppl_shipping_method_codesparameter - Zone: Select appropriate shipping zone
- Calculator: Choose your preferred shipping calculator
- Code: Use
- Check the "To PPL ParcelShop enabled" option
- Configure PPL country options:
- Display ParcelShops from selected countries: Choose which countries' parcelshops should be available for selection (multiple selection allowed)
- Default selected country on the map with ParcelShops: Choose which country will be pre-selected when the parcelshop map opens
- Save the shipping method
Important: The shipping method code must be listed in the threebrs_sylius_ppl_parcelshops_plugin_ppl_shipping_method_codes parameter (see Configuration section above). If using a custom code, add it to this parameter in your configuration.
2. Customer Checkout Flow
When a customer selects a PPL parcelshop shipping method during checkout:
- A PPL parcelshop selector widget will appear
- The customer can choose their preferred parcelshop from an interactive map
- The selected parcelshop information (ID, name, address) is saved with the shipment
- The parcelshop details are visible in the order confirmation
3. Export Shipments to PPL
- Go to the admin panel: Shipment Export
- Select the PPL ParcelShop exporter type
- Choose the shipments you want to export
- Click Export to download a CSV file
- Import the CSV file into PPL's system
The CSV export includes all necessary information for PPL processing:
- Parcelshop ID and details
- Recipient information
- Package weight and dimensions
- Cash on delivery amount (if applicable)
- Order reference
Development
Usage
- Develop your plugin in
/src - See
bin/for useful commands
Testing
After your changes you must ensure that the tests are still passing.
$ composer install
$ bin/console doctrine:schema:create -e test
$ bin/behat
$ bin/phpstan.sh
$ bin/ecs.sh
License
This library is under the MIT license.