Sunday 9 October 2011

Insert rupee symbol instead of Rs in magento

Hello Everyone,

                 Today I’m going to tell you how to change Currency symbol in magento.In simple words, This tutorial will tell to change the currency symbol of rupee (from Rs to an rupee image). By default, the currency symbol for rupee is Rs.
                 For this, you need to edit app\design\frontend\base\default\template\catalog\product\new.phtml
 if you want to change rupee symbol in new arrival page
Go to line no 38
 wherever you see the following code

<?
php echo $this->getPriceHtml($_product, true, '-new'); ?>


replace it by 


<?php
$string = $this->getPriceHtml($_product, true, '-new');
$string = str_replace("Rs", "<img src='http://www.myiris.com/insurance/images/rupee_icon.gif'>", $string);
echo $string; 
?>


You can also refer to the video showing how it actually works





Alternate Solution:


We have previously posted the solution for INR symbol. But that was playing with code, finally we were able to solve that problem in easy way. Here it goes:

Step 1: Goto: lib/Zend/Locale/Data/root.xml
  Make changes in root.xml
  find <currency type=”INR”> replace next line with this <symbol>Rs. </symbol>
save the page as rupee.js and save it inside /js folder of the root.
Step 3: Goto: \app\design\frontend\default\your-theme\layout edit page.xml
After this <block type=”page/html_head” name=”head” as=”head”>
add <action method=”addJs”><script>rupee.js</script></action>
Step 4 : Clear cache by deleting all the files and folder inside /var/cache folder. Clear cache from back-end as well.
All done, u have just replaced Rs. with INR new symbol, which was designed by an IIT Graduate.  


For any magento customization contact :
Company : Parsys Media
Mumbai Office :
Mobile No : +91-8123481528(Ashish Khadpe)

34 comments:

  1. Hi Guys

    iam unable to find these codes in Magento 1.5

    getPriceHtml($_product, true, '-new'); ?>

    Could you plz specify the path where it is located it would really be helpfull

    Thanks in Advance

    ReplyDelete
  2. i wanted to change the RS rupee sign to New RUPEES Logo

    plz let me know the path to change the symbol

    ReplyDelete
  3. Hello Electrica
    I have explain this in the form of video tutorial
    I hope this will help you
    Similar way you can change other files also like list.phtml

    ReplyDelete
  4. This worked perfect. But I found issue with the symbol in One Page Checkout module. Any help?

    ReplyDelete
  5. Hey Prasanthi
    Basically we are using javascript over here the reason why it is not coming in one page checkout may be that javascript file is not getting included.So you can to that one page checkout page and manually add that javascript code.If we get time we will definitely include this in our new video tutorial.

    ReplyDelete
  6. Hi,

    After going through both the way to change INR currency, it doesn't affect on my site. I am using 1.6.1.

    Can you help me...

    ReplyDelete
  7. Hey Mansur,

    we have tried this in Magento 1.6.1. it is working fine over there also.Problem with your application may be "rupee.js" is not getting included in webpage.You can view source and check this.If this is your problem please include this file in header.phtml file.

    ReplyDelete
  8. Hi,

    I can change the Rs by the new rupee symbol. The problem is that i want to change the entire site, what i need to replace the Rs. with what?? Can you please tell me??

    ReplyDelete
  9. Hi,

    I am using Magento version 1.6.0,for new rupee symbol and the second solution is worked perfect for me. But when I select dropdown for configurable product on detail page it's again showing "Rs." as text. Also I found this issue with one page checkout module.
    Could you please help me?

    Thanks in advance...

    ReplyDelete
  10. Hey Dolendro

    Use 2nd method for replacing Rs. with rupee symbol. It changes entire site.

    ReplyDelete
  11. Hi Rakesh

    We will work on this two pages as soon as we get time and we will post the solution.

    ReplyDelete
  12. hello, i am using 1.6.2.0,rupee sign does not change at all, i have followed the procedure as enumerated above. template hint shows price.phtml instead of new.phtml??????? please help...

    ReplyDelete
  13. hello, I have applied this Rs. code in my website http://a1dealshop.com/ and this really helps me to solve my problem and it really works. you rock.

    Thank You
    Deepmala Ram

    ReplyDelete
  14. great helping post for Indian currency?

    ReplyDelete
  15. I found a better option here:
    http://ommune.com/adding-new-currency-symbol-of-indian-rupee-inr-in-magento/

    ReplyDelete
  16. Hi Roomisha

    You haven't seen post completely. We have given two ways and second one is same as link you provided

    ReplyDelete
  17. hello,
    I'm newer to magento your post help me a lot there is another querry when i include css in my homepage it overwrite and appear
    in all pages what should i do ?

    ReplyDelete
  18. Hi jinendra

    In header.phtml you can add required CSS depenedent on page
    For e.g.
    getIsHomePage()):?>
    include your CSS

    ReplyDelete
  19. Hi friend I tried your code in my site bobbystreet.com but it's not working.

    ReplyDelete
  20. I tried it in magento 1.7.01, but it did not work

    ReplyDelete
  21. Hi,
    This method Works on frontend of the site..ya..ofcourse...its ROCKS...
    but.. i want to show the rupee symbol on all the sections like backend of the site, client's order, sales mails etc..
    can you suggest me a method for that too??

    ReplyDelete
  22. Is their any way using overrides..?
    i want to avoid making changes in any core or base file or locale folder

    ReplyDelete
  23. Its working fine every page. But one page checkout is not working rupee symbols. Please help me what i have to do for change Rs. to rupee sign at one page checkout.

    ReplyDelete
  24. Both solution is not working in 1.8.1 magento version

    ReplyDelete
  25. Hi,

    Same issues for us. Cant print the Indian currency symbol in invoice pdf printout.

    ReplyDelete
  26. Hi,
    I am a beginner. I just want to know why do some sites use images of a rupee symbol if we can code it. I went to http://en.wikipedia.org/wiki/Indian_rupee_sign they use png image of rupee symbol and olx.in too.

    ReplyDelete
  27. Hello , i have create but its not response and this link is not show any js file for rupees.

    ReplyDelete
  28. Dear blogger instead of adding js and load that js you can simply try to add ₹ this code into your lib/Zend/Locale/Data/root.xml file. I have successfully done this.

    ReplyDelete
  29. The blog was absolutely fantastic! Lot of great information which can be helpful in some or the other way. Keep updating the blog, looking forward for more contents...Great job, keep it up..
    magento development company in bangalore 

    ReplyDelete
  30. Hi guys, I am change this only using admin panel. I there any solution for this.

    ReplyDelete
  31. That's wonderful stuff you've written up here. Been searching for it all around. Great blogWebsite Development Bangalore | Web Designing Company Bangalore

    ReplyDelete