I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Reply To: Price of one coin not correct

dashed-slug.net Forums General discussion Price of one coin not correct Reply To: Price of one coin not correct

#5742
alexg
Keymaster

Hello 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