Drupal Commerce Multicurrency

Drupal commerce multicurrency

I have been working on many Drupal commerce projects both Drupal 7 and Drupal 8 and I have encountered the need for multiple currencies many times.   Drupal 8 has made it very easy to have multiple currencies.  The tricky part is when and how to switch from one currency to another. 

That is where the Drupal's commerce currency resolver module comes in handy.  The commerce currency resolver module makes it easy to switch between currencies and has also automated a currency conversion when a price has not be set in the currency the user wants to use.  e.g. The stores base currency is USD or EUR and you need 2, 4 or even 10 currencies.  Maintaining all of these prices could be tricky and hard to maintain.  On a side note and another possible blog post, using commerce feeds, each product variation's price could be imported and maintained.  

The commerce currency resolver is a really good module to get multi-currency out of the box especially if you allow your users to select their currency.  Actually, in this case, it is perfect.  Now if you want some automation with auto currency selection.  e.g. To have the Drupal commerce project auto-select the user's currency, a small module will be needed.  

That is exactly what I did this for a recent Drupal commerce project where I needed to auto select a user's currency based on their location (GEO IP based currency detection).  To do this I created a small module that leverages both the commerce currency resolver's cookie-based currency selection and the smart IP module to leverage the user's location.  Now the Drupal commerce project has GEO IP based currency selection.

 

 

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.