dashed-slug.net › Forums › General discussion › Price of one coin not correct
Tagged: exchange rates, prices, Rates
- This topic has 7 replies, 2 voices, and was last updated 5 years, 7 months ago by
megeanwasson.
-
AuthorPosts
-
February 1, 2019 at 8:46 am #5734
megeanwasson
ParticipantHi Alex,
Keep up the great work, I think we are starting to get close to fixing most bugs 🙂I have 1 coin which is not getting the correct price and am not sure why.
All the other coins are getting the correct price which can then be used inside the woocommerce plugin on products.
Just this one coin is behaving oddly.
On the coingecko ticker widget the correct price shows, on coingecko site the correct prices show in both USD and BTCI have tried with transients enabled and disabled makes not difference.
Exchange rate providers enabled and using wallets woocommerce plugin:
Fixer with api key activated
CoingeckoAny info will be great to get this resolved or steps to try and pinpoint where this is going wrong.
Regards
MeganFebruary 1, 2019 at 8:58 am #5735megeanwasson
ParticipantForgot last image
February 1, 2019 at 9:02 am #5736alexg
KeymasterHello Megan,
Thank you as always for the detailed screenshots.
My first thought would be that there is maybe a fiat currency from fixer, with the same symbol, overwriting the value. This is not the case.
Which Exchange rate providers are you using? Do you have only CoinGecko enabled?
I will investigate and let you know.
It shouldn’t be necessary, but if you want to force a reload of all exchange rates, it is very easy if you are using wp-cli:
wp option delete wallets_rates
wp transient delete wallets_rates_last_run
I will investigate on my end and let you know shortly what I found.
with regards
February 1, 2019 at 9:03 am #5737alexg
KeymasterIgnore my last question, you already mentioned which providers you are using.
February 1, 2019 at 9:09 am #5740megeanwasson
ParticipantI already tried forcing rates update after deleting on cli, made no diffs.
When it pulled in the rates those wrong ones were there again.February 1, 2019 at 9:24 am #5741alexg
KeymasterI have made a bad assumption, that coin symbols are unique, when in fact they are not.
The price you see is not that of RapidCoin (RPD) but that of Ripped (RPD).
Let me think about how to approach this…
February 1, 2019 at 10:06 am #5742alexg
KeymasterHello again,
I have a solution:
function wallets_rates_rapidcoin( $rates ) { $data = json_decode( file_get_contents( 'https://api.coingecko.com/api/v3/simple/price?ids=rapids&vs_currencies=USD,BTC' ) ); if ( $data ) { $rates['USD_RPD'] = $data->rapids->usd; $rates['BTC_RPD'] = $data->rapids->btc; } return $rates; } add_filter( 'wallets_rates', 'wallets_rates_rapidcoin', 100 );
You can insert this into your theme or as a separate one-file plugin.
Or, if you are using a file similar to this one, you can add the code at the bottom of the file.
with regards
February 1, 2019 at 10:17 am #5743megeanwasson
ParticipantHi Alex,
Great that does over-ride the price, now correct prices showing in exhange-rate and woocommerce product.You are a genius ::
-
AuthorPosts
- You must be logged in to reply to this topic.