Hey @eugyenoch,
We have just released an update that lets users register new currencies. I recommend updating to the latest version and then adding the following blocks of code into a compatibility plugin:
/**
* Register "BTC" currency
*
* @param array $currencies
*
* @return array
*
*/
function slicewp_register_custom_currency_btc( $currencies ) {
$currencies['BTC'] = array(
'name' => 'Bitcoin',
'symbol' => '₿',
'symbol_position' => 'before',
'decimal_places' => 8,
'thousands_separator' => ',',
'decimal_separator' => '.'
);
return $currencies;
}
add_filter( 'slicewp_register_currency', 'slicewp_register_custom_currency_btc' );
/**
* Set the number of decimals to save currency amounts in the database
*
* @param int $decimals
*
* @return int
*
*/
function slicewp_sanitize_amount_decimals_to_8( $decimals ) {
return 8;
}
add_filter( 'slicewp_sanitize_amount_decimals', 'slicewp_sanitize_amount_decimals_to_8' );
Alternatively, if you don’t have a compatibility plugin for your website, I’ve prepared one for adding BTC to the currency list. You can download it here.
Please try it out and let me know how it goes.
All the best,
Mihai
-
This reply was modified 4 years, 2 months ago by
iova.mihai.