web design, England, Britain, UK, belgium
 
Ulti Clocks content

Change the VirtueMart Currency Symbols for Multi-Currency

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

don

03

dec




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!
Laatste aanpassing op donderdag 03 december 2009 09:49
 

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:

Titel:
Comment:
Comments (3)
really good
3 dinsdag 29 maart 2011 11:30
dglite
thanks that was great.. Smile
Thx form Italy
2 maandag 25 oktober 2010 22:36
Augusto
Works great, thx!!
merci
1 woensdag 06 oktober 2010 16:57
faussoul
Thks



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