dpdconnect/magento2-shipping
Composer 安装命令:
composer require dpdconnect/magento2-shipping
包简介
DPD Connect - Magento2 Shipping
README 文档
README
DPD Connect for Magento 2
Integrate DPD parcel shipping directly into your Magento 2 store. Generate labels, offer Parcelshop pickup at checkout, and monitor async batches — all from the Magento admin.
Features · Requirements · Installation · Configuration · Development]
📦 Features
🏷️ Label Generation
| Feature | Description |
|---|---|
| Single label | Generate from any order page via the order actions menu |
| Bulk labels | Select multiple orders from the sales grid and process in one action |
| Return labels | Generated and stored separately from shipping labels |
| Fresh & Freeze | Temperature-controlled shipments with per-parcel expiration dates |
| Multi-parcel | Split a single order across multiple parcels via the packaging popup |
🗺️ Delivery Options
| Feature | Description |
|---|---|
| DPD Classic | Standard delivery via the unified DPD carrier with customer product selection |
| DPD Parcelshop | Embedded Google Maps picker at checkout — customer chooses a pickup point |
| DPD Predict | Home delivery with email notification for B2C and B2B MSG products |
| Saturday delivery | Method automatically hidden outside a configurable day + time window |
| Express (E10 / E12) | Guaranteed delivery before 10:00 or 12:00 |
| Guarantee 18 | Guaranteed delivery before 18:00 |
| Age check | Flag products to require recipient age verification at delivery |
⚡ Processing & Downloads
| Feature | Description |
|---|---|
| Synchronous | Small batches generated and downloaded immediately as PDF |
| Asynchronous | Larger batches queued at DPD; labels delivered via webhook callback |
| A4 and A6 | Choose the format that matches your printer |
| ZIP or merged PDF | Download bulk labels as a ZIP archive or a single merged PDF |
| Shipping list | Printable pick list for warehouse staff |
🔧 Admin & Integration
| Feature | Description |
|---|---|
| Batch monitor | Sales → DPD → Batches grid shows status of every async job |
| Label archive | Sales → DPD → Labels grid with download and mass-download actions |
| Table rates | Per-carrier custom rate tables (by weight, price, or qty) |
| Customs support | HS code, export description, and consignee data sent for international shipments |
| Multi-store | All credentials and settings configurable per website / store view |
| REST API | dpd_parcelshop_id exposed on Magento Order API via extension attributes |
✅ Requirements
| Dependency | Version |
|---|---|
| PHP | ≥ 7.2 |
| Magento Framework | ≥ 103.0.6 (Magento 2.3+) |
dpdconnect/php-sdk |
^1.1 |
| Google Maps API key | Required for Parcelshop pickup |
🚀 Installation
composer require dpdconnect/magento2-shipping
After installation run the standard Magento upgrade sequence:
php bin/magento module:enable DpdConnect_Shipping php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f php bin/magento cache:flush
Upgrade
composer update dpdconnect/magento2-shipping php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f php bin/magento cache:flush
⚙️ Configuration
Navigate to Stores → Configuration → Sales → DPD Parcelservice.
Account Settings
| Setting | Description |
|---|---|
| Username | Your DPD Connect API username |
| Password | Your DPD Connect API password (stored encrypted) |
| Depot | Your DPD depot number |
| Print format | Label paper size — A4 or A6 |
| Test Connection | Button to verify credentials against the DPD API |
Carrier Settings
Navigate to Stores → Configuration → Sales → Shipping Methods.
Each DPD carrier (DPD, DPD Pickup, DPD Predict, DPD Saturday, etc.) has its own section with price, rate type, and allowed countries.
Advanced
| Setting | Description |
|---|---|
| Include return label | Generate a return label together with every shipping label |
| Email return label | Email the return label PDF to the customer |
| Picqer mode | Store parcelshop name in the company field instead of the customer name |
| Save labels as file | Write label PDFs to disk (default: stored in the database) |
| Age check | Enable per-product age verification at delivery |
| Async threshold | Number of orders above which label generation switches to async mode |
🛠️ Development
Module structure
DpdConnect_Shipping/
├── Api/ # Interfaces (ApiCallbackInterface)
├── Block/ # Admin and frontend blocks
├── Config/Source/ # Dropdown source models
├── Controller/ # Admin + frontend controllers
├── etc/ # XML configuration (di, events, webapi, system)
├── Helper/ # DPDClient, DpdSettings, Data, OrderConvertService
├── Model/ # Carriers, ResourceModels, CheckoutConfigProvider
├── Observer/ # Order, shipment and config event observers
├── Plugin/ # Order API extension attribute plugins
├── Services/ # AuthenticationService, BatchManager, ShipmentManager
├── Setup/ # UpgradeSchema, UpgradeData
├── Ui/ # UI component providers
├── ViewModel/ # CheckShipment view model
├── i18n/ # Translations (EN, NL, DE, ES, FR, IT, PL)
└── view/ # Layout XML, templates, JS, CSS
Useful commands
# Flush cache during development php bin/magento cache:flush # Recompile dependency injection php bin/magento setup:di:compile # Reindex php bin/magento indexer:reindex # Run PHP linter vendor/bin/phplint .
Webhook endpoint
DPD calls back on this endpoint after async label generation:
POST /rest/V1/dpd-shipping/callback
No Magento authentication is required (<resource ref="anonymous"/>). The callback payload contains the job ID, parcel numbers, label data (fetched separately), and error information.
❓ FAQ
I get a "Bad credentials" error when printing a label.
If you use
env.phpto specify credentials, usebin/magento config:sensitive:setto set the password — it must be stored encrypted.bin/magento config:sensitive:set dpdshipping/account_settings/password "yourpassword"
DPD Fresh / Freeze orders fail when creating a shipment.
Fresh and Freeze products can only be shipped through the DPD order overview or the packages screen. Standard Magento shipment creation is blocked by design to ensure expiration dates and product descriptions are filled in correctly.
Labels are not appearing after async batch processing.
Check Sales → DPD → Batches for the job status. If jobs show
failed, verify the webhook URL is publicly accessible:https://your-store.com/rest/default/V1/dpd-shipping/callback
Saturday delivery is not showing at checkout.
The Saturday carrier has a configurable display window. Go to Stores → Configuration → Sales → Shipping Methods → DPD Saturday and check the "Shown from" and "Shown till" day/time settings.
dpdconnect/magento2-shipping 适用场景与选型建议
dpdconnect/magento2-shipping 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 156.5k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2019 年 10 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「magento2」 「dpd」 「dpd parcelservice」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dpdconnect/magento2-shipping 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dpdconnect/magento2-shipping 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dpdconnect/magento2-shipping 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Russian Language Pack for Magento 2
DPD Magento2 Shipping extension
DPD Connect - Magento2 Shipping GraphQL
OroCommerce DPD Integration
DPD Connect - Magento2 Shipping Hyva Compatibility module
DPD carrier api library
统计信息
- 总下载量: 156.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 23
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2019-10-11