How to Add a Custom Currency and Symbol in Woocommerce

How to Add a Custom Currency and Symbol in Woocommerce
374 Views
0
(0)

WooCommerce Custom Currency Integration

By following the instructions below, you may add a custom currency and its symbol to your WooCommerce store

Navigate to WooCommerce Dashboard > Appearance

Choose Theme File Editor.

Open functions.php which is located in the theme folder.

<?php
add_filter( 'woocommerce_currencies', 'cxc_add_new_codex_currency_call_back' );
function cxc_add_new_codex_currency_call_back( $cxc_currency ) {
	$cxc_currency['CODEXCOACH'] = __( 'CODEXCOACH CURRENCY', 'cxc-codexcoach' );
	return $cxc_currency;
}
?>

WooCommerce Custom Code Validation

<?php
add_filter('woocommerce_currency_symbol', 'cxc_add_codex_new_currency_symbol_call_back', 10, 2);
function cxc_add_codex_new_currency_symbol_call_back( $custom_currency_symbol, $custom_currency ) {
	switch( $custom_currency ) {
		case 'CODEXCOACH': $custom_currency_symbol = 'CXC₹'; break;
	}
	return $custom_currency_symbol;
}
?>

How useful was this blog?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this blog.

  • CodexCoach

    - Web Development Expert

    CodexCoach is a skilled tech educator known for easy-to-follow tutorials in coding, digital design, and software development. With practical tips and interactive examples, CodexCoach helps people learn new tech skills and advance their careers.

By Subhash Katakiya

Hey Guys, My Self Subhash Katakiya. I am a resident of Gujarat. I have 2+ years of experience in full-stack web development. Currently, I am working in CodexCoach Company. In particular, I specialize in WooCommerce, plugins, and themes. So, read my blogs and learn full-stack web development skills with my guide.

Leave a comment

Your email address will not be published. Required fields are marked *