gtgt / sylius-foxpost-shipping
Sylius Foxpost shipping plugin.
Package info
github.com/gtgt/sylius-foxpost-shipping
Type:sylius-plugin
pkg:composer/gtgt/sylius-foxpost-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 16:52:40 UTC
README
Sylius 2.x shipping plugin for the Hungarian Foxpost parcel-locker and home-delivery service using the FoxWeb API.
Features
- Custom Sylius shipping calculator (
foxpost) with flat-rate pricing. - Supports both parcel-locker (APM) and home-delivery (HD) shipping methods.
- Hourly-synced parcel-locker list from
https://cdn.foxpost.hu/foxplus.json. - Checkout APM selector (search by city/name/ZIP).
- Admin parcel creation, label download and tracking refresh.
- Admin grid of all shipments using a Foxpost 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-foxpost-shipping
Enable the bundle
// config/bundles.php SyliusFoxpostShippingPlugin\SyliusFoxpostShippingPlugin::class => ['all' => true],
Add routes
# config/routes/sylius_foxpost.yaml sylius_foxpost: resource: '@SyliusFoxpostShippingPlugin/config/routes.yaml'
Extend the Shipment entity
The plugin stores Foxpost-specific data on the Sylius Shipment entity. Make your application Shipment entity extend the plugin's mapped superclass:
// src/Entity/Shipping/Shipment.php namespace App\Entity\Shipping; use Doctrine\ORM\Mapping as ORM; use SyliusFoxpostShippingPlugin\Entity\Shipment as BaseShipment; #[ORM\Entity] #[ORM\Table(name: 'sylius_shipment')] class Shipment extends BaseShipment { }
Then generate and run a migration:
bin/console doctrine:migrations:diff bin/console doctrine:migrations:migrate
Configuration
Create one or two Sylius shipping methods using the Foxpost calculator:
- one with Send type =
APMfor parcel-locker delivery - one with Send type =
HDfor home delivery
Each shipping method requires:
- Environment (
test/prod) - Basic auth username
- Basic auth password
- API key
- Default parcel size (
XS/S/M/L/XL) - Flat rate amount
Sender details are resolved from the channel (contactEmail, contactPhoneNumber and shopBillingData).
Usage
Sync parcel lockers
bin/console foxpost:apm:sync
The list is cached for one hour and refreshed automatically on checkout usage.
Admin actions
Open a shipment that uses a Foxpost shipping method. The Foxpost card lets you:
- Create the parcel in Foxpost.
- 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