Override How a Currency Symbol Displays in WooCommerce
Some currencies don't have a widely-recognized symbol, so WooCommerce falls back to something unclear. This swaps in a custom symbol for a specific currency code instead — the example below covers Bulgarian Lev (BGN).
function wc_change_bgn_currency_symbol( $currency_symbol, $currency ) {
switch ( $currency ) {
case 'BGN':
$currency_symbol = 'BGN';
break;
}
return $currency_symbol;
}
add_filter( 'woocommerce_currency_symbol', 'wc_change_bgn_currency_symbol', 10, 2 );
More WooCommerce snippets
Add a Custom Post Type Through WooCommerce
Lets a non-`product` post type behave like a purchasable WooCommerce item — pulling its price from a custom field and giving it a working "Add to Cart" button, without converting it into an actual Product post type.
Reorder (and Rename) the My Account Menu Tabs
Controls the exact order the tabs appear in on the WooCommerce My Account page, and lets you rename any of them at the same time — including slotting in a custom tab you've added elsewhere.
Add a Custom Tab to the WooCommerce My Account Page
Registers a brand new endpoint (in this example, "Premium Support") and adds it as its own tab in the My Account menu, complete with its own content area — the standard pattern for extending My Account with anything WooCommerce doesn't ship by default.