WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Addition of currency (12 posts)

  1. levzi
    Member
    Posted 2 years ago #

    Upon installing WooCommerce theme, i do not seem to have the option of selecting my wanted currency. In this case I need for my customers to pay in the Nigerian currency i.e. the Naira. Any ideas on how I can get this currency to the drop down list?

    Kind Regards,
    Adam Niazi

    http://wordpress.org/extend/plugins/woocommerce/

  2. levzi
    Member
    Posted 2 years ago #

    Just to add that I am not experienced in any way with coding.

  3. mikejolley
    Member
    Plugin Author

    Posted 2 years ago #

  4. levzi
    Member
    Posted 2 years ago #

    I have tried copy and pasting:

    add_filter( 'woocommerce_currencies', 'add_my_currency' );

    function add_my_currency( $currencies ) {
         $currencies['NGN'] = __( 'Naira', 'woocommerce' );
         return $currencies;
    }

    add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);

    function add_my_currency_symbol( $currency_symbol, $currency ) {
         switch( $currency ) {
              case 'NGN': $currency_symbol = '₦'; break;
         }
         return $currency_symbol;
    }

    Using 'FileZilla' I uploaded this coding to the beginning of the file:
    /wp-content/plugins/woocommerce/woocommerce-functions.php

    that didn't work so i tried uploading it to:
    /wp-content/plugins/woocommerce/woocommerce-core-functions.php

    Any ideas why it will not work correctly?
    Is my code wrong, am I uploading it to the wrong file, is there a specific area within the file I need to upload it?

    If you could help, I would sincerely appreciate it.

    Kind Regards,
    Adam Niazi

  5. mikejolley
    Member
    Plugin Author

    Posted 2 years ago #

    Don't add the code to core - add it to your theme's functions.php file.

  6. levzi
    Member
    Posted 2 years ago #

    What do you mean by to the 'core'? And also just to inform you that I am using the WooCommerce plugin with the Flexishop theme. So I still upload it to the Flexishop theme rather than the WooCommerce plugin.

    To make this slightly easier to understand could you tell me which folder I would find this functions.php file in please.

    Thanks for your help so far.

    Kind Regards,
    Adam Niazi

  7. mikejolley
    Member
    Plugin Author

    Posted 2 years ago #

  8. levzi
    Member
    Posted 2 years ago #

    That link doesn't really help me much 'mikejolley'.

    It merely states what the functions.php file does.

    Kind Regards,
    Adam Niazi

  9. mikejolley
    Member
    Plugin Author

    Posted 2 years ago #

    If you read it...

    A theme can optionally use a functions file, which resides in the theme subdirectory and is named functions.php.

  10. levzi
    Member
    Posted 2 years ago #

    thanks thats all done now!

  11. ADvi
    Member
    Posted 1 year ago #

    And what about switching position of the currency label?
    The default is '$ 100', but I need to be '100 UAH' (or '100 $'), so the label needed to be in the end. Can I do this?

  12. ADvi
    Member
    Posted 1 year ago #

    Sorry, found in settings..

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic