dhl/module-unified-tracking
Composer 安装命令:
composer require dhl/module-unified-tracking
包简介
Integrate the DPDHL Group tracking web service into Magento® 2 carrier modules.
README 文档
README
The DHL Unified Tracking extension offers an integration of the Shipment Tracking - Unified API into the Magento® 2 platform.
Description
This extension enables integrators to request tracking details for a given DHL shipment. The extension does not display tracking status and tracking history on its own. It accepts a tracking number and will return the tracking details in a format suitable for use in Magento® 2. The UI integration needs to be realized within a carrier module or similar.
Requirements
- PHP >= 8.3
- PHP Internationalization extension
Compatibility
- Magento 2.4.8+
Installation Instructions
Install sources:
composer require dhl/module-unified-tracking
Enable module:
./bin/magento module:enable Dhl_UnifiedTracking
./bin/magento setup:upgrade
Flush cache and compile:
./bin/magento cache:flush
./bin/magento setup:di:compile
Uninstallation
To unregister the tracking module from the application, run the following command:
./bin/magento module:uninstall Dhl_UnifiedTracking
composer update
Usage
Tracking details can be obtained from the web service by either enabling the carrier plugin or using the tracking service directly.
The web service allows to filter results by DHL divisions.
Carrier Plugin
The tracking extension comes with a plugin that can be enabled to replace a carrier's
original \Magento\Shipping\Model\Carrier\AbstractCarrierOnline::getTrackingInfo method.
<type name="Vendor\Module\Model\Carrier"> <plugin name="dhlgw_get_tracking_info" type="Dhl\UnifiedTracking\Plugin\Carrier\GetTrackingDetails"/> </type>
The request for tracking info will then be picked up by the tracking extension and
return a result object ready to be processed by the Magento_Shipping core module.
Tracking Service
The tracking extension offers an integration point that can be used to request
tracking details from the web service: \Dhl\UnifiedTracking\Api\TrackingInfoProviderInterface::getTrackingDetails.
Using the tracking service directly can be useful if the result needs to be modified
before passing it to the Magento_Shipping core module.
// \Vendor\Module\Model\Carrier::getTrackingInfo public function getTrackingInfo($tracking) { $result = $this->trackingInfoProvider->getTrackingDetails($tracking, $this->getCarrierCode()); if ($result instanceof \Magento\Shipping\Model\Tracking\Result\Error) { // create link to portal if web service returned an error $statusData = [ 'tracking' => $tracking, 'url' => 'https://trackntrace.carrier.com/?track=' . $tracking, ]; $result = $this->_trackStatusFactory->create(['data' => $statusData]); } return $result; }
Limit Web Service Results
The tracking web service is able to return results from across DHL divisions. If the integration is only meant to request tracking details from a certain carrier (e.g. DHL Paket), then the web service results should be filtered by providing a tracking configuration object via DI configuration:
<type name="Dhl\UnifiedTracking\Model\Pipeline\Stage\SendRequestStage"> <arguments> <argument name="configurations" xsi:type="array"> <item name="fooCarrierCode" xsi:type="object">Vendor\Foo\Model\TrackingConfiguration</item> <item name="barCarrierCode" xsi:type="object">Vendor\Bar\Model\TrackingConfiguration</item> </argument> </arguments> </type>
The carrier code is the identifier of the Magento® carrier that the tracking number belongs to. Compare
\Magento\Sales\Api\Data\TrackInterface::getTrackNumber\Magento\Sales\Api\Data\TrackInterface::getCarrierCode
See API docs for a list of available service names.
Support
In case of questions or problems, please have a look at the Support Portal (FAQ) first.
If the issue cannot be resolved, you can contact the support team via the Support Portal or by sending an email to dhl.support@netresearch.de.
License
OSL - Open Software Licence 3.0
Copyright
(c) 2021 DPDHL Group
dhl/module-unified-tracking 适用场景与选型建议
dhl/module-unified-tracking 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 291.68k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 03 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 dhl/module-unified-tracking 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dhl/module-unified-tracking 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 291.68k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 32
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2020-03-31