Hi there,

I try to extend the multi-currency support of commerce.
For now I've created a small module which allows you to:

  • set exchange rate for each "from currency to currency" combination.
  • configure for each"from currency to currency" combination whether to synchronize the rate or not.
  • synchronize the current rates from the European Central Bank (doesn't provide all currencies!).
  • define your own synchronisation provider.

You can check out the module from here: https://github.com/das-peter/commerce_currency
A screen-shot is also attached.

To integrate this functionality a small, fully backward compatible, change in commerce itself is necessary.
Similar to the format_callback I introduced the conversion_callback which is called from commerce_currency_convert if present.

Comments

rszrama’s picture

Wow! Any chance you'll post this to a separate project or something? I'm gearing up for an RC and won't be adding any new modules until 2.x, and something like this may be better in contrib anyways - would allow it to be continually improved regardless of the core development status.

das-peter’s picture

Sure - I just didn't have the time yet to see how I've to proceed to get the own project ;)
The idea behind the new callback is exactly to be able to decouple this code.

rszrama’s picture

Oh, I see. I didn't get that the patch was to commerce.module itself. Why could you not use the primary conversion callback... conversion itself should be the same math every time, right, based on conversion_rate values altered into the currency info array?

rszrama’s picture

Status: Needs review » Fixed

Whoops, forgot about this one sitting in needs review. Committed.

Automatically closed -- issue fixed for 2 weeks with no activity.