This plugin allows you to generate shipping labels for TNT carrier.
- 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
Prerequisite: you must first configure/install the bitbag/shipping-export-plugin
Install plugin with composer
composer require waaz/sylius-tnt-pluginAdd 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'} %}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
Prerequisite: you must first configure/install the setono/sylius-pickup-point-plugin
- PHPSpec
vendor/bin/phpspec run- Behat (non-JS scenarios)
vendor/bin/behat --strict --tags="~@javascript"-
Behat (JS scenarios)
-
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
- 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
- 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- @ehibes for Studio Waaz
This plugin's source code is completely free and released under the terms of the MIT license.
