• Resolved clakmal9

    (@clakmal9)


    Dear All experts

    Can anyone tell me how to change woocommerce currency symbol ?? to Rs
    i need only change symbol please advise me how to do that

    thanks

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Gerhard Potgieter

    (@kloon)

    Hi, you will need to hook into the woocommerce_currency_symbol filter and then set the symbol to Rs. Something along these lines

    
    add_filter( 'woocommerce_currency_symbol', 'my_custom_currency_symbol' );
    function my_custom_currency_symbol( $symbol, $currency ) {
        return 'Rs';
    }
    
    Thread Starter clakmal9

    (@clakmal9)

    Hi Gerhad

    it doesn’t work and Sadly after pasting this code, it crashed my site. Had to go in via cpanel and remove plugin to get the website back.

    • This reply was modified 6 years, 3 months ago by clakmal9.
    Plugin Contributor Gerhard Potgieter

    (@kloon)

    Hi, sorry about that. I should have made it clear I did not test the code but provided it as a guide.

    Here is the tested code that I can confirm work.

    
    add_filter( 'woocommerce_currency_symbol', 'my_custom_currency_symbol' );
    function my_custom_currency_symbol( $symbol ) {
        return 'Rs';
    }
    
    Thread Starter clakmal9

    (@clakmal9)

    Hi, Thanks for your time but unfortunately its not working on site

    Plugin Contributor Gerhard Potgieter

    (@kloon)

    Hi, it definitely works, tested it on my site https://cld.wthms.co/LltWpq

    Thread Starter clakmal9

    (@clakmal9)

    Hi how to add the code? I was trying it using PHP code snippet plugin

    Thread Starter clakmal9

    (@clakmal9)

    Plugin Contributor Gerhard Potgieter

    (@kloon)

    I am not familiar with the plugin, try adding the code to your theme’s function.php file, or use the theme customisation plugin and add it to that functions.php file https://github.com/woocommerce/theme-customisations

    Thread Starter clakmal9

    (@clakmal9)

    Hi

    finally its done thanks a lot i did that as you said
    thanks again

    Hi Guys,

    thanks for the above questions and answers, I came across the same, Gerhard – Thanks mate for the coding but this changes all the currencies to have (in my case QA instead of Rs), and when I get the translation to Arabic Its different meaning also.

    Please help.

    Thanks,

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘how to change woocommerce currency symbol’ is closed to new replies.