datadesignit Posted December 22, 2005 Share Posted December 22, 2005 I've scoured the forums for an answer on this one. . . I have users from USA and Canada. Once the user is logged in, I want the user to see prices in their respective currencies based on their customer profile country. I do not want them to have to select a language or currency. They should see the appropriate prices throughout, until they log out. So, I understand in the URL if I have "...php?currency=CAD ...", the appropriate currency will be displayed. How do I either force this in the URL, or force the display of the appropriate currency behind-the-scenes. Thank you very much. I think there must be some simple answer I'm overlooking. . . I played around with application_top.php without success. Link to comment Share on other sites More sharing options...
♥Vger Posted December 22, 2005 Share Posted December 22, 2005 Language and currencies are linked, so either US or Canadian Dollars can be the default currency for the English language, by setting Switch To Default Language Currency to true in osC admin. osCommerce will detect the language setting in the users browser, but your problem is that you want people who both use English as their default language to see different currencies as they arrive on your website. There may be a way to do it but it would involve some "if then else" coding in application_top.php, along with setting up a seperate 'language' for Canadian and setting Canadian Dollars as the default currency for the Canadian language. If you see what I mean. Vger Link to comment Share on other sites More sharing options...
datadesignit Posted December 22, 2005 Author Share Posted December 22, 2005 Yes, thank you on that advice. I set up canadian.php along with a canadian folder as you recommended, and made the necessary changes. It's the IF-ELSE logic I'm having problems with--where to get the variable and have it pass throughout the session. Link to comment Share on other sites More sharing options...
♥Vger Posted December 22, 2005 Share Posted December 22, 2005 Okay, Internet Explorer at least recognises English(Canada) as a seperate language from English(United States) or English(United Kingdom), so you'd have to hope that the browser detection script in osCommerce will take care of and recognise that. That code is in includes/application_top.php, from around line 264 to 285 Try installing the Canadian Dollar (if you haven't already done so), and in includes/languages/canadian.php make sure that 'USD' is changed to the three letter code for Canadian Dollars. Finally, make sure that Switch To Default Language Currency is set to true. In your browser delete all Temporary Internet Files and all Offline Content and set your browser to always look for the newest version of pages you visit. Then try going to your site and see if Canadian Dollars is displayed as the currency. If that works change the language on your computer to English(United States) and go back to your site and see if it changes to US Dollars. If not then you'd have to look for some code that would do the recognition for you and change the currency displayed. Vger Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.