Bluntknife Posted February 4, 2007 Share Posted February 4, 2007 Hi all, A strange problem... My site is setup to use GBP and USD currencies and the exchange rates etc are all set up as they should be. The default currency is GBP. If I select to use USD the page refreshes and the currency symbol changes to $ BUT the product prices stay the same..? For example see my site: www.DigiARTonline.com I do not recall making any alterations that would affect this calculation. I hope someone can help me or point me in the right direction! Thanks :thumbsup: Link to comment Share on other sites More sharing options...
ComicWisdom Posted February 4, 2007 Share Posted February 4, 2007 Hi all, A strange problem... My site is setup to use GBP and USD currencies and the exchange rates etc are all set up as they should be. The default currency is GBP. If I select to use USD the page refreshes and the currency symbol changes to $ BUT the product prices stay the same..? For example see my site: www.DigiARTonline.com I do not recall making any alterations that would affect this calculation. I hope someone can help me or point me in the right direction! Thanks :thumbsup: Go back to your admin and make sure you have the currencies installed properly. Your drop down selection box does not have a USD option. See code from your site below: <form name="currencies" action="http://www.digiartonline.com/product_info.php" method="get"><select name="currency" onChange="this.form.submit(); " style="width:100px; font-size: 9px" ><option value="GBP" SELECTED>British Pound</option></select><input type="hidden" name="products_id" value="214"></form> Just between us, remember there are only 10 kinds of people in the world; those who understand binary and those who don't!! Remember, learning is a "do-it-yourself" experience; although, not necessarily a "do-it-BY-yourself" experience. The quickest way to learn is to forget to BACKUP! Link to comment Share on other sites More sharing options...
Bluntknife Posted February 4, 2007 Author Share Posted February 4, 2007 I removed the USD currency after a couple of hours of posting my problem as i don't want people to start paying $2 for photographs when they cost £2..! I can put it back on if you need to check the code. The problem is exactly how i've written above though, when selecting to view prices in USD the page refreshes, the dollar sign is dislpayed next to the product price but the price isn't converted to USD. Link to comment Share on other sites More sharing options...
Bluntknife Posted February 5, 2007 Author Share Posted February 5, 2007 Nobody had this problem before? It's pretty major - please help!!! Link to comment Share on other sites More sharing options...
wheeloftime Posted February 5, 2007 Share Posted February 5, 2007 Nobody had this problem before? It's pretty major - please help!!! You are using a 3th party template where they also changed a lot of core code and who knows what they touched. I have seen this template working though with others so either your setup is wrong or you have made further changes which have broken osCommerce in this area. Link to comment Share on other sites More sharing options...
Bluntknife Posted February 5, 2007 Author Share Posted February 5, 2007 Thanks for your reply but I don't understand why someone would mess around with the calculation code if all they're doing is altering the look and feel of the site? All basic functionality works apart from this one bit..! :( Link to comment Share on other sites More sharing options...
Bluntknife Posted February 5, 2007 Author Share Posted February 5, 2007 Does anyone even know where the code is that re-calculates the product prices on currency change? Thanks. Link to comment Share on other sites More sharing options...
wheeloftime Posted February 5, 2007 Share Posted February 5, 2007 Does anyone even know where the code is that re-calculates the product prices on currency change? Thanks. Essentialy it, the currency box, just changes a global currency variable and refreshes the pages. All parts of osCommerce which have prices show those through the display_price() function which uses the format() function. Both are defined within the currencies class so you can start to look if something is changed there. As the currency symbol does change the currency box by itself seems to work. Link to comment Share on other sites More sharing options...
Bluntknife Posted February 5, 2007 Author Share Posted February 5, 2007 Excellent, thanks. I'll report back any findings I make. Link to comment Share on other sites More sharing options...
Bluntknife Posted February 5, 2007 Author Share Posted February 5, 2007 Essentialy it, the currency box, just changes a global currency variable and refreshes the pages. All parts of osCommerce which have prices show those through the display_price() function which uses the format() function. Both are defined within the currencies class so you can start to look if something is changed there. As the currency symbol does change the currency box by itself seems to work. Ok I checked the currencies class file and have noticed a small difference from the original. The <SPAN> commands are missing from lines 42 and 49..? As these were the only differences between my file and the original i backed mine up and put the original on my server. Now when changing from GBP to USD on the site the product prices are recalculated sucessfully. BUT................................. Now my product attribute options are displaying the HTML <SPAN> sections of lines 42 and 49 from my currencies class file..!!! :'( Now what..? I don't know how to cure this problem...someone please help. Thanks. Link to comment Share on other sites More sharing options...
wheeloftime Posted February 5, 2007 Share Posted February 5, 2007 Ok I checked the currencies class file and have noticed a small difference from the original. The <SPAN> commands are missing from lines 42 and 49..? As these were the only differences between my file and the original i backed mine up and put the original on my server. Now when changing from GBP to USD on the site the product prices are recalculated sucessfully. BUT................................. Now my product attribute options are displaying the HTML <SPAN> sections of lines 42 and 49 from my currencies class file..!!! :'( Now what..? I don't know how to cure this problem...someone please help. Thanks. This is the lines 42 to 50 from an original osC currencies.php class file: if ($calculate_currency_value == true) { $rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value']; $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right']; // if the selected currency is in the european euro-conversion and the default currency is euro, // the currency will displayed in the national currency and euro currency if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) { $format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>'; } } else { $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right']; } I see no <span> tags here... Link to comment Share on other sites More sharing options...
Bluntknife Posted February 5, 2007 Author Share Posted February 5, 2007 This is the lines 42 to 50 from an original osC currencies.php class file: if ($calculate_currency_value == true) { $rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value']; $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right']; // if the selected currency is in the european euro-conversion and the default currency is euro, // the currency will displayed in the national currency and euro currency if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) { $format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>'; } } else { $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right']; } I see no <span> tags here... :blink: I've just cut & pasted your code into my file and now EVERYTHING works!!! :D I'm so happy. Obviously my 'original' file isn't as original as yours. Thanks for the help wheeloftime. Link to comment Share on other sites More sharing options...
wheeloftime Posted February 5, 2007 Share Posted February 5, 2007 :blink: I've just cut & pasted your code into my file and now EVERYTHING works!!! :D I'm so happy. Obviously my 'original' file isn't as original as yours. Thanks for the help wheeloftime. Your welcome. Glad it could help :D Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.