yaroslavche/sylius-exchange-rates-updater-plugin

Sylius exchange rates update console command.

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 0

Type:sylius-plugin

pkg:composer/yaroslavche/sylius-exchange-rates-updater-plugin

This package is auto-updated.

Last update: 2025-10-06 11:37:40 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