Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Wants changed currency to remain changed.


Foffo

Recommended Posts

Posted

Background information to understand my question:

I'm building a page with dual languages & to that I've made one currency default on each.

e.g.

When pushing the British flag you get £ as default currency & the page in English. then when you push the Swedish flag you'll get the entire page in Swedish & with the SKR as a default currency.

I have one problem though & that is the fact that I've got several other currencies for customers to choose from e.g. & USD.

It works fine switching the currency & getting every price in the right currency to the right rate, BUT when you then click on a different menu or have the main-area of the page reloaded (due to browsing through the sub-menus or something like that) it switches back to the default currency of the chosen language. Quite annoying...

 

I figure this is due to the fact that every time application_top.php is evoked the static defined variable DEFAULT_CURRENCY sets the currency to that default value it contains. So I came to think about the idea of just using a simple if/else to check if the currency has been altered by the user & in that case skip the DEFAULT_CURRENCY & use a variable, where the users chosen currency has been stored away, to be used next time any page / sub-menu is to be loaded.

That brings us to the fact that I need a file in the Online Merchant 2.2 that I'm running, that won't be reloaded or drop it's variables until the user wants to change currency again or leave the page.

 

This brings us to my question:

Is it possible to somehow keep/use a function with a string (that's given the value of the DEFAULT_CURRENCY when it's first made but then can be altered when a user chooses another currency from the drop_down_menu so that the user don't have to switch currency more than once), in let's say .../includes/boxes/sessions.php since the session-file will only be loaded when the user visits the page the first time, am I correct?

I'm not quite sure about this so... I would be happy if I could get an explanation or maybe access to a file over the files/functions in the standard build of the template.

Something like java.sun's API's (Java Sun API example) would be a dream coming true.

 

Is there anyone who knows if this is possible (ehrm... correction, it's possible alright, but I refer to the fact that I wanted to use the session.php file as a storage for my temp-file & I'm not that used to OSC to determine where it would be most beneficial for me to store my temp & how to actually code it) to solve in a nice smooth way?

Well... I'll be satisfied with an ugly solution to begin with as well... as long as I have something to work with & have had my question marks straightened out.

 

Thanks in advance for taking you time.

-Robert

Posted

if i were you i owuld first assume the osc developer(s) are intelligent/clever enough to think about and dealing this issue and hace it built into osc already.

to my understanding, language & currency are two separated things - changing one does not necessarily changes the other, UNLESS you have the "Switch To Default Language Currency" set to ture in admin - configuration.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Posted
if i were you i owuld first assume the osc developer(s) are intelligent/clever enough to think about and dealing this issue and hace it built into osc already.

to my understanding, language & currency are two separated things - changing one does not necessarily changes the other, UNLESS you have the "Switch To Default Language Currency" set to ture in admin - configuration.

 

Ken

 

 

I assumed so, but I think that was wrong of me.

I know for a fact that the currency changes when reloading the pages... & I want the "Default Language Currency" activated if a user don't feel like switching the currency... however IF they want to change the currency I want their choice to override the "Default Language Currency" for that session.

There's gotta be a way to get this to work... but haven't figured out how yet though...

 

-Robert

Posted

well, i may not understand your question fully but this is how the unmodified osCommerce behaves:

 

1. suppose you select spanish as the language and euro as the currency;

 

2. you then change the language to english whose default currency is either british pound or US$ depending on your setup, the currency should remain euro, NOT british pound or US$, until you change it to either £ or $.

 

so, isnt that what you want? and what is the problem?

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Posted
well, i may not understand your question fully but this is how the unmodified osCommerce behaves:

 

1. suppose you select spanish as the language and euro as the currency;

 

2. you then change the language to english whose default currency is either british pound or US$ depending on your setup, the currency should remain euro, NOT british pound or US$, until you change it to either £ or $.

 

so, isnt that what you want? and what is the problem?

 

Ken

 

 

No, the thing I want is:

When the page loads in English it should load with USD as currency & when you load it in Swedish it should load in SKR...

UNLESS the user has changed the currency to something else before that... lets say he changed it to USD or € when having the page in Swedish, then it should remain USD or € when he loads the next menu in Swedish...

 

Somewhat overriding the DEFAULT_LANGUAGE....

-Robert

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...