Ulti Clocks content

Change the VirtueMart Currency Symbols for Multi-Currency

JOOMLABOTTOM sand How to change the VirtueMart Currency Symbols for a Multi-Currency Shop.
symbol, currency, function, virtuemart, getfullvalue, like, change, resetsymbol, break, case, looks, default, add, decimals, global, old, res, vendor, store, code, usd, eur, display, currencies, position, thanks, cases, look, euro, gbp, globals, erik, product, switch, better, called, php, multi, shop, symbols

Home Joomla - VirtueMart Joomla & VM How To's Change the VirtueMart Currency Symbols for Multi-Currency

Jeu

03

Change the VirtueMart Currency Symbols for Multi-Currency
  • Joomla 1.5
  • VirtueMart 1.1

The VirtueMart default currency symbol is configured in the Admin-->Store-->Edit Store-->Currency Display Style but in a multi-currency Shop you just have the default currency symbols like EUR and USD for the other currencies.
I found this hack to solve this in the VirtueMart forums.



Change the default VirtueMart Currency Symbols for Multi-Currency Open the file administrator/components/com_virtuemart/classes/currency/class_currency_display.php and go to around line 122. It is the getFullValue function and looks like this..
 
function getFullValue($nb, $decimals='', $symbol = '') {
    global $vendor_currency;
    $res = "";
    if( $symbol != ''  ) {
      $old_symbol = $this->symbol;
      $this->symbol = $symbol;
    }
 
    // Currency symbol position
 
We need to add a new function called resetSymbol and call it after the getFullValue.
So change the code to look like...
 
  //Change currency symbol
 
  function resetSymbol()
  {
           switch($GLOBALS['product_currency'])
          {
                  case 'USD': $this->symbol='$';break;
                  case 'EUR': $this->symbol='€ ';break;
                  case 'GBP': $this->symbol='£ ';break;
 
          }
  }
  function getFullValue($nb, $decimals='', $symbol = '') {
    global $vendor_currency;
    $res = "";
    if( $symbol != ''  ) {
      $old_symbol = $this->symbol;
      $this->symbol = $symbol;
    }
 
   $this->resetSymbol(); //Call the change currency symbol function
    // Currency symbol position
 

You can add further cases for further currencies. Thanks to Erik P for this code.
Looks much better!

Changed VirtueMart Currency Symbols for Multi-Currency


Add this page to your favorite Social Bookmarking websites
Digg! Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! Slashdot! Technorati! StumbleUpon! Spurl! Newsvine! Furl! Fark! Yahoo! Netvouz! Mister-Wong! RawSugar! Ma.gnolia! Squidoo! DZone! Swik!
LAST_UPDATED2
 

Add your comment

BoldItalicUnderlineStrikethroughSubscriptSuperscriptEmailImageHyperlinkOrdered listUnordered listQuoteCodeHyperlink to the Article by its id
Very HappySmileWinkSadSurprisedShockedConfusedCoolLaughingMadRazzEmbarrassedCrying or Very SadEvil or Very MadTwisted EvilRolling EyesExclamationQuestionIdeaArrowNeutralMr. GreenGeekUber Geek
Your name:
  The word for verification.
Lowercase letters only with no spaces.

The word for verification.<br/>Lowercase letters only with no spaces.
Word verification:

Titre:
Comment:
Comments (3)
really good
3 Mardi, 29 Mars 2011 11:30
dglite
thanks that was great.. Smile
Thx form Italy
2 Lundi, 25 Octobre 2010 22:36
Augusto
Works great, thx!!
merci
1 Mercredi, 06 Octobre 2010 16:57
faussoul
Thks

Our Recommended Reading

For those interested in extending their knowledge of Joomla! & VirtueMart, Packt Publishing has an excellent range of help & how to books.
Listed below are some I can recommend.
Simply click on the images to be taken directly to their web shop.


Joomla! Social Networking with JomSocial
Joomla! Social Networking
with JomSocial

by Kwasi Boateng & Beatrice A. Boateng.
Joomla! 1.5 Multimedia
Joomla! 1.5 Multimedia
by Allan Walker.


Building job sites with Joomla!
Building job sites with Joomla!
by Santonu Kumar Dhar.

Joomla! Template Design: Create your own professional-quality templates with this fast, friendly guide
Joomla! Template Design: 2nd Edition
Create your own professional-quality
templates with this fast, friendly guide
by Tessa Blakeley Silver.
Magento: Beginner's Guide
Magento: Beginner's Guide by William Rice
is a must for anyone trying the
open-source e-Commerce solution.

Read the review

object-oriented-javascript-applications-libraries
Object-Oriented JavaScript by
Stoyan Stefanov gives you a very
comprehensive grounding in
the latest Javascript techniques.

Read the review
Joomla! Web Security
Joomla! Web Security
by Tom Canavan.

Joomla 1.5 Top Extensions Cookbook
Joomla 1.5 Top Extensions Cookbook by
Suhreed Sarkar is an ideal and concise round up of the extensions available for the Joomla! system.

Read the review

Latest Articles

Paypal Donation

If you use this module on your site please donate a small amount.
Any donation amount appreciated.

VM Live Product Search

Recommended Reading

For those interested in extending there knowledge of Joomla! & VirtueMart Packt Publishing has an excellent range of help & how to books.
Listed below are some I can recommend.
Simply click on the images to be taken directly to their web shop.

Mastering Joomla! 1.5 Extension and Framework Development
Mastering Joomla! 1.5 Extension and
Framework Development : 2nd Edition

by James Kennard.
Read the review

Building job sites with Joomla!
Building job sites with Joomla!
by Santonu Kumar Dhar.
Learning Joomla! 1.5 Extension Development Learning Joomla! 1.5 Extension Development
by Joseph L. LeBlanc.
Read the review
Joomla! E-Commerce with VirtueMart
Joomla! E-Commerce with VirtueMart
by Suhreed Sarkar.

Read the review
Joomla! 1.5 Site Blueprints Joomla! 1.5 Site Blueprints
by Timi Ogunjobi.

Joomla! 1.5 JavaScript jQuery Joomla! 1.5 JavaScript jQuery
by Jose Argudo Blanco.
Read the review
Joomla! Social Networking with JomSocial Joomla! Social Networking with JomSocial
by Kwasi Boateng & Beatrice A. Boateng.

Joomla! 1.5 Multimedia Joomla! 1.5 Multimedia
by Allan Walker.

Joomla! Web Security Joomla! Web Security
by Tom Canavan.

Mastering Joomla! 1.5 Extension and Framework Development Mastering Joomla! 1.5 Extension and Framework Development : 2nd Edition
by James Kennard.

Joomla! Template Design: Create your own professional-quality templates with this fast, friendly guide Joomla! Template Design: Edition 2 - Create your own professional-quality templates with this fast, friendly guide
by Tessa Blakeley Silver.

Magento: Beginner's Guide
Magento: Beginner's Guide by William Rice
is a must for anyone trying the
open-source e-Commerce solution.

Read the review

JOOMLABOTTOM



Change the VirtueMart Currency Symbols for Multi-Currency



How to change the VirtueMart Currency Symbols for a Multi-Currency Shop.


symbol, currency, function, virtuemart, getfullvalue, like, change, resetsymbol, break, case, looks, default, add, decimals, global, old, res, vendor, store, code, usd, eur, display, currencies, position, thanks, cases, look, euro, gbp, globals, erik, product, switch, better, called, php, multi, shop, symbols