waaz / sylius-tnt-plugin
This TNT plugin enables you to easily print shipping labels and show available pickup locations for customers to choose from.
Installs: 59
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Type:sylius-plugin
Requires
- php: ^8.0
- bitbag/shipping-export-plugin: ^3.0
- nyholm/psr7: ^1.8
- setono/sylius-pickup-point-plugin: ^1.1
- sylius/sylius: ^1.11
- winzou/tnt-express: ^1.1.1
Requires (Dev)
- ext-json: *
- behat/behat: ^3.7
- behat/mink: ^1.9
- dmore/behat-chrome-extension: ^1.4
- dmore/chrome-mink-driver: ^2.8
- friends-of-behat/mink: ^1.9
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.1
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- phpspec/phpspec: ^7.0
- phpstan/extension-installer: ^1.2
- phpstan/phpstan-doctrine: ^1
- phpstan/phpstan-strict-rules: ^1
- phpstan/phpstan-webmozart-assert: ^1
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- sylius-labs/coding-standard: ^4.0
- symfony/browser-kit: ^5.4|^6.0
- symfony/debug-bundle: ^5.4|^6.0
- symfony/dotenv: ^5.4|^6.0
- symfony/http-client: ^5.4|^6.0
- symfony/intl: ^5.4|^6.0
- symfony/runtime: ^5.4|^6.0
- symfony/web-profiler-bundle: ^5.4|^6.0
- symfony/webpack-encore-bundle: ^1.16
- vimeo/psalm: ^4|^5
Conflicts
- doctrine/orm: >= 2.16.0
This package is not auto-updated.
Last update: 2024-12-10 08:19:37 UTC
README
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)
-
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
Author
- @ehibes for Studio Waaz
License
This plugin's source code is completely free and released under the terms of the MIT license.