Adding byteball as a display currency
-
Tried adding numerous variations of GBYTE, byte, MG, and B for currency name and symbol by adding following to functions.php, but none work.
I can only get payments to process if a native Woocommerce currency is selected under settings. I would like to display bytes or MB’s only.
add_filter( ‘woocommerce_currencies’, ‘add_bb_currency’ );
function add_bb_currency( $bb_currency ) {
$bb_currency[‘byteball bytes’] = __( ‘byteball bytes’, ‘woocommerce’ );
return $bb_currency;
}
add_filter(‘woocommerce_currency_symbol’, ‘add_bb_currency_symbol’, 10, 2);
function add_bb_currency_symbol( $custom_currency_symbol, $custom_currency ) {
switch( $custom_currency ) {
case ‘byteball bytes’: $custom_currency_symbol = ‘B’; break;
}
return $custom_currency_symbol;
}Thank you
- The topic ‘Adding byteball as a display currency’ is closed to new replies.