infifni / sylius-fan-courier-plugin
Infifni FAN Courier plugin for Sylius.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:sylius-plugin
Requires
- php: ^7.3
- ext-json: *
- bitbag/shipping-export-plugin: dev-master
- infifni/fan-courier-api-client: ^1.0
- sylius/sylius: ^1.7
Requires (Dev)
- behat/behat: ^3.4
- behat/mink: ^1.7@dev
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.2
- behat/mink-selenium2-driver: ^1.3
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.0
- friends-of-behat/variadic-extension: ^1.1
- lakion/mink-debug-extension: ^1.2.3
- phpspec/phpspec: ^5.0
- phpstan/phpstan-doctrine: ^0.11
- phpstan/phpstan-shim: ^0.11
- phpstan/phpstan-webmozart-assert: ^0.11
- phpunit/phpunit: ^8.0
- sensiolabs/security-checker: ^5.0
- sylius-labs/coding-standard: ^3.0
- symfony/browser-kit: ^3.4|^4.3
- symfony/debug-bundle: ^3.4|^4.3
- symfony/dotenv: ^4.3
- symfony/intl: ^3.4|^4.3
- symfony/web-profiler-bundle: ^3.4|^4.3
- symfony/web-server-bundle: ^3.4|^4.3
This package is auto-updated.
Last update: 2024-10-11 18:18:24 UTC
README
Sylius FAN Courier plugin
License MIT
This plugin works with selfawb.ro API and provides shipping cost estimation from FAN Courier provider (using their API).
This plugin was made on top of Bitbag Shipping Export abstraction layer, with some modifications.
Also the services provided by FAN Courier are based in Romania, you'll most likely have errors for other regions.
Prerequisites
You'll need an account on https://www.selfawb.ro/ and also a contract that will be signed after you make an explicit request to sales@fancourier.ro. There are many services to choose from, the one you choose must be also selected when defining a shipping gateway at point 4.
Installation
-
Install Bitbag Shipping Export plugin, the Infifni modified version.
1.1. Add a section repositories to your main application composer.json file with the following:
{ "repositories": [ { "type": "vcs", "url": "https://github.com/infifni/SyliusShippingExportPlugin" } ] }
1.2. Follow installation steps from https://github.com/infifni/SyliusShippingExportPlugin except the composer require step. That step should be:
composer require bitbag/shipping-export-plugin:dev-master
-
Install Sylius FAN Courier plugin.
2.1. Composer install.
composer require infifni/sylius-fan-courier-plugin
2.2. Add plugin dependencies to your
config/bundles.php
file (this is done automatically with flex):// config/bundles.php return [ // other lines Infifni\SyliusFanCourierPlugin\InfifniSyliusFanCourierPlugin::class => ['all' => true], ];
2.3. Import resource:
// config/packages/infifni_sylius_fan_courier_plugin.yaml imports: - { resource: "@InfifniSyliusFanCourierPlugin/Resources/config/resource/infifni_shipping_awb.yml" }
2.4. Execute database migration (check the queries in case you already have data in database):
cd /project/root cp vendor/infifni/sylius-fan-courier-plugin/src/Migrations/Version20200606093404.php src/Migrations bin/console doctrine:mig:mig
-
Define a shipping method at /admin/shipping-methods/new.
- name it FAN Courier and whatever pleases you
- the only mandatory thing here is to select for Calculator the FAN calculator, it will be used for cost estimation
-
Define a new gateway at /admin/shipping-gateways/new/fan and use the shipping method defined at 4.
Common pitfalls
What to do ?
If you've experienced such a pitfall normally you can solve it by changing the names provided. If the error persists please report an issue in Github.
You can also regularly watch the logs (dev.log, prod.log) and search errors containing 'Shipping estimation failed for shipment with id'. If you can solve them please do and do a pull request to the project. If not please report the issue, especially if it's not an exception enumerated above.