yaroslavche / sylius-exchange-rates-updater-plugin
Sylius exchange rates update console command.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:sylius-plugin
Requires
- php: ^7.1
- guzzlehttp/guzzle: ^6.3
- sylius/sylius: ~1.2.3
- symfony/symfony: ^3.4|^4.1
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/context-service-extension: ^1.2
- friends-of-behat/cross-container-extension: ^1.1
- friends-of-behat/service-container-extension: ^1.0
- friends-of-behat/symfony-extension: ^1.2.1
- friends-of-behat/variadic-extension: ^1.1
- lakion/mink-debug-extension: ^1.2.3
- phpspec/phpspec: ^4.0
- phpstan/phpstan-doctrine: ^0.10
- phpstan/phpstan-shim: ^0.10
- phpstan/phpstan-symfony: ^0.10
- phpstan/phpstan-webmozart-assert: ^0.10
- phpunit/phpunit: ^6.5
- sylius-labs/coding-standard: ^2.0
This package is auto-updated.
Last update: 2024-11-06 09:53:09 UTC
README
bin/console sylius:exchange-rates:generate
This command generate all available unique currency pairs from Sylius available currencies.
Update exchange rates
bin/console sylius:exchange-rates:update
This command try to update all existing exchange rates in Sylius.
Install
composer require yaroslavche/sylius-exchange-rates-updater-plugin
Register plugin
# app/AppKernel.php # ... public function registerBundles(): array { $bundles = [ # ... new \Acme\SyliusExchangeRatesUpdaterPlugin\AcmeSyliusExchangeRatesUpdaterPlugin(), ]; #... }
Import service config
#app/config/config.yml imports: # ... - { resource: '@AcmeSyliusExchangeRatesUpdaterPlugin/Resources/config/services.yml' } # ...
And add params:
#app/config/parameters.yml parameters: # ... exchange_rates_updater_plugin.openexchangerates: 'your_api_key' exchange_rates_updater_plugin.fixer: 'your_api_key' # not used now
Usage
For daily update add following to crontab:
0 0 * * * /path_to_sylius/bin/console sylius:exchange-rates:update