Currency domain

Currency Commands

AddCurrencyCommand

PrestaShop\PrestaShop\Core\Domain\Currency\Command\AddCurrencyCommand Class AddCurrencyCommand used to add an official currency

Command details
Constructor parameters
  • $string $isoCode
  • $float $exchangeRate
  • $bool $isEnabled
Handler class PrestaShop\PrestaShop\Adapter\Currency\CommandHandler\AddOfficialCurrencyHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Currency\CommandHandler\AddCurrencyHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\Currency\ValueObject\CurrencyId

AddUnofficialCurrencyCommand

PrestaShop\PrestaShop\Core\Domain\Currency\Command\AddUnofficialCurrencyCommand Class AddUnofficialCurrencyCommand used to add an alternative currency

Command details
Constructor parameters
  • $string $isoCode
  • $float $exchangeRate
  • $bool $isEnabled
Handler class PrestaShop\PrestaShop\Adapter\Currency\CommandHandler\AddUnofficialCurrencyHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Currency\CommandHandler\AddUnofficialCurrencyHandlerInterface
Return type PrestaShop\PrestaShop\Core\Domain\Currency\ValueObject\CurrencyId

BulkDeleteCurrenciesCommand

PrestaShop\PrestaShop\Core\Domain\Currency\Command\BulkDeleteCurrenciesCommand Deletes given currencies

Command details
Constructor parameters
  • $array $currencyIds
Handler class PrestaShop\PrestaShop\Adapter\Currency\CommandHandler\BulkDeleteCurrenciesHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Currency\CommandHandler\BulkDeleteCurrenciesHandlerInterface
Return type void

BulkToggleCurrenciesStatusCommand

PrestaShop\PrestaShop\Core\Domain\Currency\Command\BulkToggleCurrenciesStatusCommand Enables/disables currencies status

Command details
Constructor parameters
  • $array $currencyIds
  • $bool $expectedStatus
Handler class PrestaShop\PrestaShop\Adapter\Currency\CommandHandler\BulkToggleCurrenciesStatusHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Currency\CommandHandler\BulkToggleCurrenciesStatusHandlerInterface
Return type void

DeleteCurrencyCommand

PrestaShop\PrestaShop\Core\Domain\Currency\Command\DeleteCurrencyCommand Class DeleteCurrencyCommand is responsible for deleting Currency.

Command details
Constructor parameters
  • $int $currencyId
Handler class PrestaShop\PrestaShop\Adapter\Currency\CommandHandler\DeleteCurrencyHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Currency\CommandHandler\DeleteCurrencyHandlerInterface
Return type void

EditCurrencyCommand

PrestaShop\PrestaShop\Core\Domain\Currency\Command\EditCurrencyCommand Class EditCurrencyCommand

Command details
Constructor parameters
  • $int $currencyId
Handler class PrestaShop\PrestaShop\Adapter\Currency\CommandHandler\EditOfficialCurrencyHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Currency\CommandHandler\EditCurrencyHandlerInterface
Return type void

EditUnofficialCurrencyCommand

PrestaShop\PrestaShop\Core\Domain\Currency\Command\EditUnofficialCurrencyCommand __

Command details
Constructor parameters
  • $int $currencyId
Handler class PrestaShop\PrestaShop\Adapter\Currency\CommandHandler\EditUnofficialCurrencyHandler

Implements:

  • PrestaShop\PrestaShop\Core\Domain\Currency\CommandHandler\EditUnofficialCurrencyHandlerInterface
Return type void

RefreshExchangeRatesCommand

PrestaShop\PrestaShop\Core\Domain\Currency\Command\RefreshExchangeRatesCommand Class RefreshExchangeRatesCommand

Command details
Constructor parameters
    Handler class PrestaShop\PrestaShop\Adapter\Currency\CommandHandler\RefreshExchangeRatesHandler

    Implements:

    • PrestaShop\PrestaShop\Core\Domain\Currency\CommandHandler\RefreshExchangeRatesHandlerInterface
    Return type void

    ToggleCurrencyStatusCommand

    PrestaShop\PrestaShop\Core\Domain\Currency\Command\ToggleCurrencyStatusCommand Class ToggleCurrencyStatusCommand is responsible for changing the status of the currency.

    Command details
    Constructor parameters
    • $int $currencyId
    Handler class PrestaShop\PrestaShop\Adapter\Currency\CommandHandler\ToggleCurrencyStatusHandler

    Implements:

    • PrestaShop\PrestaShop\Core\Domain\Currency\CommandHandler\ToggleCurrencyStatusHandlerInterface
    Return type void

    Currency Queries

    GetCurrencyExchangeRate

    PrestaShop\PrestaShop\Core\Domain\Currency\Query\GetCurrencyExchangeRate Retrieves the exchange rate for a currency compared to the shop's default

    Query details
    Constructor parameters
    • $string $isoCode
    Handler class PrestaShop\PrestaShop\Adapter\Currency\QueryHandler\GetCurrencyExchangeRateHandler

    Implements:

    • PrestaShop\PrestaShop\Core\Domain\Currency\QueryHandler\GetCurrencyExchangeRateHandlerInterface
    Return type PrestaShop\PrestaShop\Core\Domain\Currency\QueryResult\ExchangeRate

    GetCurrencyForEditing

    PrestaShop\PrestaShop\Core\Domain\Currency\Query\GetCurrencyForEditing Class GetCurrencyForEditing

    Query details
    Constructor parameters
    • $int $currencyId
    Handler class PrestaShop\PrestaShop\Adapter\Currency\QueryHandler\GetCurrencyForEditingHandler

    Implements:

    • PrestaShop\PrestaShop\Core\Domain\Currency\QueryHandler\GetCurrencyForEditingHandlerInterface
    Return type \PrestaShop\PrestaShop\Core\Domain\Currency\QueryResult\EditableCurrency

    GetReferenceCurrency

    PrestaShop\PrestaShop\Core\Domain\Currency\Query\GetReferenceCurrency Get reference currency data, which are data from the unicode CLDR database, thus only official currencies have one. The result is exposed with a ReferenceCurrency object, and if the currency doesn't exist a CurrencyNotFoundException is thrown.

    Query details
    Constructor parameters
    • $string $isoCode
    Handler class PrestaShop\PrestaShop\Adapter\Currency\QueryHandler\GetReferenceCurrencyHandler

    Implements:

    • PrestaShop\PrestaShop\Core\Domain\Currency\QueryHandler\GetReferenceCurrencyHandlerInterface
    Return type PrestaShop\PrestaShop\Core\Domain\Currency\QueryResult\ReferenceCurrency