承接 waaz/sylius-tnt-plugin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

waaz/sylius-tnt-plugin

最新稳定版本:0.6

Composer 安装命令:

composer require waaz/sylius-tnt-plugin

包简介

This TNT plugin enables you to easily print shipping labels and show available pickup locations for customers to choose from.

README 文档

README

Logo

GitHub Workflow Status Scrutinizer Code Quality

WaazSyliusTntPlugin

This plugin allows you to generate shipping labels for TNT carrier.

Features

  • Shipping label export
  • Check that the postal code and city match for TNT : for this feature, if the country chosen is 'FR' then the city field becomes a select with city proposals from the tnt webservice

Installation (exporting label part)

Prerequisite: you must first configure/install the bitbag/shipping-export-plugin

Install plugin with composer

composer require waaz/sylius-tnt-plugin

Add plugin dependencies to your config/bundles.php file:

return [
    ...

    Waaz\SyliusTntPlugin\WaazSyliusTntPlugin::class => ['all' => true],
];

Add route in your config/routes/sylius_shop.yaml file:

...
waaz_tnt_shop:
    resource: "@WaazSyliusTntPlugin/Resources/config/routing/shop_tnt.yaml"

Add parameter validation_groups in your config/services.yaml file:

parameters:
    ...
    sylius.form.type.checkout_address.validation_groups: ['sylius', 'tnt_address']

Run assets install command : bin/console assets:install

Add plugin asset in templates/bundles/SyliusShopBundle/_scripts.html.twig file

{% include '@SyliusUi/_javascripts.html.twig' with {'path': 'assets/shop/js/app.js'} %}
{% include '@SyliusUi/_javascripts.html.twig' with {'path': 'bundles/waazsyliustntplugin/js/tnt-city.js'} %}

Configuration

You can configure this plugin by creating a file config/packages/waaz_sylius_tnt_plugin:

# Defaults values
waaz_sylius_tnt:
    username: 'login' # Enter your tnt username here. You should use an environment variable like `%env(TNT_PASSWORD)%`
    password: 'password' # Same for password
    sandbox: true  # Sandbox mode
    weight_unit: 'g' # 'g' or 'kg'. Weight unit you use in your shop
    city_select_classes: 'ui dropdown' # Classes you want for city select field

Installation (pickup point part)

Prerequisite: you must first configure/install the setono/sylius-pickup-point-plugin

Running Tests

  • PHPSpec
vendor/bin/phpspec run
  • Behat (non-JS scenarios)
vendor/bin/behat --strict --tags="~@javascript"
  • Behat (JS scenarios)

    1. Install Symfony CLI command.

    2. Start Headless Chrome:

    google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1
    1. Install SSL certificates (only once needed) and run test application's webserver on 127.0.0.1:8080:
    symfony server:ca:install
    APP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon
    1. Run Behat:
    vendor/bin/behat --strict --tags="@javascript"
  • Psalm

    vendor/bin/psalm
  • PHPStan

vendor/bin/phpstan analyse -c phpstan.neon -l max src/  
  • Coding Standard
vendor/bin/ecs check src

Author

License

This plugin's source code is completely free and released under the terms of the MIT license.

统计信息

  • 总下载量: 67
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-01