Thu 03 Dec |
|
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. 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 positionWe 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! |
Last Updated on Thursday, 03 December 2009 09:49 |