Jump to content

Different currencies for backend and frontend


Recommended Posts

Hi,

I have a question regarding my new online store: is there any possibility to set up two different currencies, for the front end US Dollars and for the back end Euros? I need to do that because I buy the products in Euros and I sell them only in US Dollars, so for the front end I need to show only US Dollar.

Thank you.

Link to comment
Share on other sites

You can't configure different currencies in FO and BO.

If you only need 1 currency in the FO, a solution may be to activate both currencies, disable the currency selector in the FO and choose the FO currency as the default one. So only this currency will be used in the FO.

Link to comment
Share on other sites

One way can be to hack the Tools::setCurrency() method.
It seems this method compute the current currency to display in FO not used in BO.

So, in file classes/Tools.php, in method setCurrency(), replace

$currency = new Currency(intval(Configuration::get('PS_CURRENCY_DEFAULT')));


by

$currency = new Currency(2);


2 for Dollar, 1 for Euro

Keep the DEFAULT_CURRENCY for the currency in which you buy your product
Set the FO currency by the setCurrency method


You have to remove the cookie to have it working.
I've just tested the FO display.
You need to test the full sequence

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...