Skip to main content

Product Rate Conversion

Converts product prices between currencies using configured exchange rates. Only activates when no direct price exists for the target currency.

Installation

import '@unchainedshop/plugins/pricing/product-price-rateconversion';

How It Works

  1. Checks if a price already exists in the calculation (skips if yes)
  2. Looks up a price in any available currency for the product
  3. Fetches the exchange rate between source and target currencies
  4. Converts and adds the price to the calculation

Prerequisites

  • Exchange rates must be configured in the database
  • Both source and target currencies must be active

Setting Exchange Rates

Exchange rates are managed through the products.prices.updateRates module method. Use one of the built-in worker plugins to update rates automatically:

Or update rates programmatically:

await unchainedAPI.modules.products.prices.updateRates([
{
baseCurrency: 'CHF',
quoteCurrency: 'EUR',
rate: 0.95,
timestamp: new Date(),
},
]);

Adapter Details

PropertyValue
Keyshop.unchained.pricing.rate-conversion
Version1.0.0
Order Index10
Sourcepricing/product-price-rateconversion.ts