fmdd / sylius-mondial-relay-plugin
Sylius Mondial Relay 插件。
Requires
- php: ^8.0
- ext-curl: *
- ext-soap: *
- sylius/sylius: ~1.10.0 || ~1.11.0 || ~1.12.0
README
目录
概述
此插件可以在您的 Sylius 网站上启用 Mondial Relay 配送方式。
安装
使用 composer 安装插件
$ composer require sherlockode/sylius-mondial-relay-plugin
完成配置
# config/packages/sherlockode_sylius_mondial_relay.yaml sherlockode_sylius_mondial_relay: wsdl: The mondial relay WSDL merchant_id: Your merchant ID private_key: Your private key
导入路由
# config/routes.yaml sherlockode_sylius_mondial_relay_plugin: resource: "@SherlockodeSyliusMondialRelayPlugin/Resources/config/routing.xml"
在您的 Shipment 实体中,导入 PickupPointTrait
<?php // App/Entity/Shipping/Shipment.php namespace App\Entity\Shipping; use Doctrine\ORM\Mapping as ORM; use Sherlockode\SyliusMondialRelayPlugin\Model\PickupPointTrait; use Sylius\Component\Core\Model\Shipment as BaseShipment; /** * @ORM\Entity * @ORM\Table(name="sylius_shipment") */ class Shipment extends BaseShipment { use PickupPointTrait; }
别忘了之后进行迁移或 d:s:u 操作
更新 webpack 配置以在商店配置和后台配置中添加条目
// Shop config Encore // ... .addEntry('sherlockode-mondial-relay', './vendor/sherlockode/sylius-mondial-relay-plugin/src/Resources/public/js/entry.js') // Admin config Encore // ... .addEntry('sherlockode-mondial-relay', './vendor/sherlockode/sylius-mondial-relay-plugin/src/Resources/public/js/admin.js')
使用
配送方式配置
现在您只需创建一个新的配送方式。对于配送费用选项,选择“Mondial Relay”
Google API 集成
为了显示 Google 地图以选择取货点,您需要为您的令牌启用 Google 地图 API。您可以在 Google Cloud Console 中完成此操作。然后,更新插件配置
# config/packages/sherlockode_sylius_mondial_relay.yaml sherlockode_sylius_mondial_relay: # ... map_provider: google google_api_key: '%env(GOOGLE_API_KEY)%'
此外,您可能还希望启用 Google Place API,以便在搜索取货点时显示地点建议。
Open Street Map 集成
此插件还支持 Open Street Map。要启用它,只需更新插件配置中的 map_provider
设置即可
# config/packages/sherlockode_sylius_mondial_relay.yaml sherlockode_sylius_mondial_relay: # ... map_provider: open_street_map
打印快递票
当订单使用 Mondial Relay 支付后,您可以从 Sylius 后台打印快递票。转到订单详情页面,并使用“打印票”按钮。
此功能可以从组件配置中禁用
sherlockode_sylius_mondial_relay: # ... enable_ticket_printing: false
演示 Sylius 商店
我们创建了一个演示应用程序,其中包含一些有用的插件用例!访问 sylius-demo.sherlockode.fr 查看它。管理员可以通过 sylius-demo.sherlockode.fr/admin/login 链接访问。我们在演示中使用的插件
开发者额外资源
要了解更多关于我们的贡献流程和其他信息,我们鼓励您使用以下资源
许可证
此插件的源代码完全免费,并按照 MIT 许可证条款发布。
联系方式
如果您想联系我们,最佳方式是在我们的网站上填写表格 我们的网站 或发送电子邮件至 contact@sherlockode.fr 与我们联系。我们保证尽快回复您!