Support for gold and silver; Islamic Gold Dinar and Silver Dirham.
Dear all,
I have made a fork of Drupal commerce on github. I am working on adding support for Islamic Gold Dinar and Silver Dirham. http://github.com/themuslimprince/drupalcommerce
I need to add support for products having their 'price' in either gold or silver, it can be a decimal amount ie 1.46 e-dinar, which equates to a fraction of gold bullion.
I need to add support for multiple currencies simultaneously therefore, to support 'silver' and 'gold', which are separate currencies.
At the end of the checkout the cheaper products, will be in silver and the more expensive products will be in gold. For example: Total is: 4.56 e-dirham (silver) + 5.67 e-dinar (gold)
The payment will then involve a transaction between e-dinar accounts.
I am quite capable of implementing this myself, but any pointers for adding currencies and being able to choose a currency per product would be highly appreciated.
Thanks,
Abdalaleem Andrew James Potter



Comments
lol - My immediate reaction
lol - My immediate reaction on seeing the title of this post was "Wow, impressive spam for someone selling gold and silver." Then I read the post and realized you're just looking to deal with a tricky situation in the code. ; )
At this point, it might be a little premature for me to give a lot of advice. I'm actually knee deep in currency storage / price alteration for the next day or two, so anything I say is likely to change.
Right now there is a default currency setting that all price fields will default to. However, at the product level, you could specify a different currency when you're entering a price. This is going to create problems, though, when doing something like totalling the cost of a shopping cart without having core support for currency conversion. That bears more brainstorming...
Given that you can use
Given that you can use fractions perhaps it might be simpler to define prices in gold and then have a convert to silver option at checkout. That way all you need to keep up with is one variable i.e. Dinar/Dirham ratio. This would also help clients who prefer to trade in one or the other.
Base value and conversions
If a base value was defined such as widgets = 1 value of worth and 1 gold (gram) = 23.4 widgets, 1 silver (gram) = 304 widgets then the value of a product/service would have a global value weight. When dealing with commodities I could see the need to update the conversion index from a free or paid source.
Definitely a challenging pickle to crack.
It is one thing to devise a standard value matrix and correlate different monies for each item's value. It is another to also provide currency switching for both customers and administrators.
1) Currency Matrix
2) Customer Currency Selection
3) Administrator Currency Selection