gtgt / sylius-mpl-shipping
Sylius MPL shipping plugin.
Package info
github.com/gtgt/sylius-mpl-shipping
Type:sylius-plugin
pkg:composer/gtgt/sylius-mpl-shipping
Requires
- php: ^8.3
- sylius/sylius: ^2.1
- symfony/http-client: ^6.4 || ^7.2
Requires (Dev)
- phpunit/phpunit: ^10.5
- sylius-labs/coding-standard: ^4.4
- symfony/browser-kit: ^6.4 || ^7.2
- symfony/debug-bundle: ^6.4 || ^7.2
- symfony/dotenv: ^6.4 || ^7.2
- symfony/intl: ^6.4 || ^7.2
- symfony/web-profiler-bundle: ^6.4 || ^7.2
- symfony/web-server-bundle: ^6.4 || ^7.2
- vimeo/psalm: 3.11.4
This package is auto-updated.
Last update: 2026-08-05 22:57:55 UTC
README
Sylius 2.x shipping plugin for the Hungarian MPL shipping service using MPL API v2.
Features
- Custom Sylius shipping calculator (
mpl) with flat-rate pricing. - Supports domestic delivery modes: HA, CS, PP, PM.
- OAuth2 Client Credentials authentication against MPL API.
- Checkout delivery-place selector for CS/PP/PM methods.
- Admin shipment creation, label download, tracking refresh, and shipment close action with fee storage.
- Admin grid of shipments using the MPL method.
- COD is disabled in v1 (always sent as
0).
Requirements
- PHP
^8.3 - Sylius
^2.1 - Symfony HTTP Client
^6.4 || ^7.2
Installation
composer require gtgt/sylius-mpl-shipping
Enable the bundle
// config/bundles.php SyliusMplShippingPlugin\SyliusMplShippingPlugin::class => ['all' => true],
Add routes
# config/routes/sylius_mpl.yaml sylius_mpl: resource: '@SyliusMplShippingPlugin/config/routes.yaml'
Database migration
The plugin stores MPL-specific shipment data in a dedicated sylius_mpl_shipment table. Run migrations:
bin/console doctrine:migrations:migrate
Configuration
Create one or more Sylius shipping methods using the MPL calculator:
- one for each required delivery mode (
HA,CS,PP,PM)
Each shipping method configuration requires:
- Environment (
test/prod) - OAuth client ID
- OAuth client secret
- Accounting code
- Developer name
- Sender agreement and sender contact/address data
- Delivery mode
- Basic service code (for domestic defaults:
A_176_NET) - Default label type/format
- Flat rate amount
Usage
Sync delivery places cache
bin/console cache:pool:clear cache.app
Delivery places are cached for one hour and refreshed automatically on checkout usage.
Admin actions
Open a shipment that uses a MPL shipping method. The MPL card lets you:
- Create the parcel in MPL.
- Download the PDF label.
- Refresh the tracking status.
Creating a parcel automatically generates and stores the label timestamp.
Development
Run tests:
vendor/bin/phpunit
License
LGPL-3