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

Change the VirtueMart Currency Symbols for Multi-Currency

GJC Web Design Joomla & VirtueMart how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help

A collection of help articles and coding examples for Joomla & Virtuemart

Belgium, VirtueMart & Joomla Web Design England UK Britain & Germany

Joomla, VirtueMart, how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help 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

Thu

03

Dec

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 Updated on Thursday, 03 December 2009 09:49 Read : 1821 times
 

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:
Subject:
Comment:

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.

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! Web Security Joomla! Web Security
by Tom Canavan.

Mastering Joomla! 1.5 Extension and Framework Development Mastering Joomla! 1.5 Extension and Framework Development
by James Kennard.

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

GJC Web Design Joomla & VirtueMart how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help

A collection of help articles and coding examples for Joomla & Virtuemart

Belgium, VirtueMart & Joomla Web Design England UK Britain & Germany

Joomla, VirtueMart, how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help



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