News:

Looking for documentation? Take a look on our wiki

Main Menu

How can you add BTC as a currency? Numeric code not accepted by virtuemart

Started by virtuoos, July 01, 2018, 20:38:01 PM

Previous topic - Next topic

virtuoos

Hello,
I am trying to add Bitcoin as a currency, but that seems impossible because in Configuration -> Currencies -> New you can fill out the data for Bitcoin,
but the field "Numeric Code" makes it impossible to add Bitcoin as it has no  ISO 4217 numeric code.

I bought the Coinbase Commerce payment plugin to make it possible to accepte BTC payments,
but now it turns out you can not add BTC in Virtuemart itself....

Does anyone know how to add BTC as a currency in Virtuemart?

Thanks and regards
Joomla! 3.9.14
VirtueMart 3.6.10

Studio 42

If your currency have no official iso number, define your own and use one that cannot conflict.
Max value is 2147483647

virtuoos

Hi Studio 42,

Thank you for helping. Could you please explain a little bit more how to "define your own" . What files do I have to edit? It is not just picking a number and using it, is it?
In the Currencies -> Currency Details -> Numeric Code you can only enter a number of 3 digits maximum.
Joomla! 3.9.14
VirtueMart 3.6.10

Studio 42

I have never try, but you can check wat number is not used in your database, you have not 999 currency numbers in the world
See https://fr.iban.com/currency-codes.html or download it here https://www.currency-iso.org/en/home/tables/table-a1.html but i think that you find this list in many other websites

jenkinhill

The ISO 4217 currency code for Bitcoin is XBT. However, at the moment it is an unofficial code according to the ISO 4217 standard.

https://www.xe.com/currency/xbt-bitcoin
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

virtuoos

Hi,

Thank you for helping. I tried to enter XBT in the Numeric Code field, but it does not accept letters, only digits. With phpMyadmin I looked up the table virtuemart_currencies , currency_numeric_code  which is set to int(4). Maybe I can change that so it accepts letters too. Maybe that is something that can be adjusted in virtuemart in future, would be great if you couls easily add cryptocurrencies too.

Cheers
Joomla! 3.9.14
VirtueMart 3.6.10

virtuoos

I tried several un-used Numeric Codes but if I select Bitcoin as currency, the price does not show in the front-end.
Hopefully there are users who know how to get virtuemart show prices in Bitcoin, that would ge great.
This is what I did to add Bitcoin;

Configuration -> Currencies -> +New   add Bitcoin as currency with following settings:

currency Name: Bitcoin
Published: Yes
Exchange Rate: 0.0000
Code 2 Letters:
Code 3 Letters: BTC
Numeric Code: 181                 (I also tested with 045, 991 and 999 )
Currency Symbol: Ƀ                 (Thai Baht symbol, resembles BTC symbol the most)
Decimals: 8
Decimal Symbol: .
Thousands Separator: ,
Positive Format:
Negative Format:

In Shop -> Shop -> Vendor  the Currency is set to Bitcoin and the List of accepted currencies are: Bitcoin and United States Dollar  -> if I select United States Dollar then the prices show in $ in the front-end, if I select Bitcoin no prices are shown)

In Products -> Product -> Product Information I have a product with Cost price: 0.025 and Bitcoin selected to the right of it. -> it makes no difference if I select Bitcoin or USD, in both cases the price does not show. Also, in the Producs List the column Produc Price does not show a value.

If anybody knows the way how to get your Product Price show in Bitcoin in the front-end, please let me know, thank you!


Joomla! 3.9.14
VirtueMart 3.6.10

jenkinhill

I have never done it for BTC but the character code is <i class="fa fa-btc"></i> using Font Awsome
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

virtuoos

Thank you for the tip.

I do not understand why Virtuemart does not show the price as soon as you set it to Bitcoin, even while BTC is added as a new currency. I guess it has to do with the Numeric Code.
Is there a way around maybe by editing code?

I bought the CoinBase Commerce plugin especially to be able to process Bitcoin payments, but now it turns out Virtuemart can not handle Bitcoin.... :-\

By now I have spend 2 days trying to solve this. It is a pity but I guess I have to move over to another shop that is capable of processing BTC prices and payments...  :'(
Joomla! 3.9.14
VirtueMart 3.6.10

Jörgen

This sound to me like hogwash, is it this plugin You bought ?

https://extensions.joomla.org/browse/new/extension/extension-specific/virtuemart-extensions/coinbase-commerce-cryptocurrencies-for-virtuemart/

If the developer states that it should work with Virtuemart, then it should. Contact the developer, this should not be so hard.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

virtuoos

Thank you for the tip, I already emailed them. It is that plugin yes.
But the plugin only comes in play after you added the product to the Cart and proceed to the Payment.
The problem of the price not showing up, occurs well before that, at the moment you try to add Bitcoin as a currency and try to show it on the frontside...
Joomla! 3.9.14
VirtueMart 3.6.10

jenkinhill

Quote from: virtuoos on July 02, 2018, 14:05:07 PM
now it turns out Virtuemart can not handle Bitcoin.... :-\

Of course VM can handle any currency, no matter what the actual currency, GBP, USD, EU etc, VM works just with numbers, it is just the symbol that changes. Getting a suitable symbol to show could be done by using a suitable unused or real ISO code and attaching the symbol to that. Alternative route would be to use template overrides.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

virtuoos

hi jenkinhill,

I wish you were right it was that simple and just a symbol problem. I am sure you won't be able to either to come up with prices in the frontend if you add BTC. Just try this:

Configuration -> Currencies -> +New   add Bitcoin as currency with following settings:

currency Name: Bitcoin
Published: Yes
Exchange Rate: 0.0000
Code 2 Letters:
Code 3 Letters: BTC
Numeric Code: 181                 (I also tested with 045, 991 and 999 )
Currency Symbol: Ƀ                 (Thai Baht symbol, resembles BTC symbol the most)
Decimals: 8
Decimal Symbol: .
Thousands Separator: ,
Positive Format:
Negative Format:

In Shop -> Shop -> Vendor  the Currency is set to Bitcoin and the List of accepted currencies are: Bitcoin and United States Dollar  -> if I select United States Dollar then the prices show in $ in the front-end, if I select Bitcoin no prices are shown)

In Products -> Product -> Product Information I have a product with Cost price: 0.025 and Bitcoin selected to the right of it. -> it makes no difference if I select Bitcoin or USD, in both cases the price does not show. Also, in the Producs List the column Produc Price does not show a value.
Joomla! 3.9.14
VirtueMart 3.6.10

Jörgen

If you had looked at the dollar specification you would have seen something like this
{symbol} {number}
This is for showing positive numbers, work out the details for the negative numbers and put that also into currency bitcoin.
Regards
Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

virtuoos

Joomla! 3.9.14
VirtueMart 3.6.10