gtgt/sylius-mpl-shipping

Sylius MPL shipping plugin.

Maintainers

Package info

github.com/gtgt/sylius-mpl-shipping

Type:sylius-plugin

pkg:composer/gtgt/sylius-mpl-shipping

Transparency log

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master / 1.0.x-dev 2026-08-05 22:56 UTC

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