Forums / Currencies & Sales Taxes, VAT, GST, etc. / Force display of other currency than default?

Force display of other currency than default?

Views: 5,687

Results 1 to 14 of 14
17 Nov 2011, 9:26 PM
#1
joesoap avatar

joesoap

New Zenner

Join Date:
Nov 2011
Posts:
7
Plugin Contributions:
0

Force display of other currency than default?

Hi there ladies! :cool:, I have scoured the vast ocean of zen cart related posts and cannot find the answer to this relatively simple problem:

What I hope to achieve:

Default/base currency: GBP
(currency in which I buy from the supplier and base my pricing on)

Displayed currency: Only EURO
(customers only in euro zone)

I dont want the customer to have the choice to select currencies, so I have gotten rid of the currency drop down. **How do I get zen cart to always automatically display EURO when the a customer visists the store and not the default GBP. **

Seems simple enough, maybe I have been a bit of a noon and missed this one! :ohmy:

Thanks in advanced,
Joe Soap

Zen cart version: 1.3.9
<a href="http://vauvakauppa.fi/index.php?main_page=index">Vauvakauppa.fi</a>

18 Nov 2011, 4:01 PM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Force display of other currency than default?

Well, you need to set the variable $_SESSION['currency'] to the right value.

So basically you need to have GBP and EURO enabled. THis would normally mean that the user could choose between the two. When they choose it sets $_SESSION['currency']. Instead of letting them choose you force that variable to be what you want.

If that is all greek to you just add this line

$_SESSION['currency'] = 'EUR';

At the bottom of the file includes/init_includes/init_currencies.php. It needs to go just above the '?>' at the end of the file.

And you need to check that you have euros enabled.

Nick
iszent.com

24 Nov 2011, 10:41 PM
#3
joesoap avatar

joesoap

New Zenner

Join Date:
Nov 2011
Posts:
7
Plugin Contributions:
0

Re: Force display of other currency than default?

Hey nice work niccol,
you nailed it on the head. Anyone else having issues with having a supplier based price list always in one currency and displaying it only in another do as was mentioned! :clap:

Zen cart version: 1.3.9
<a href="http://vauvakauppa.fi/index.php?main_page=index">Vauvakauppa.fi</a>

31 Jan 2013, 5:55 PM
#4
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Force display of other currency than default?

Just got to say niccol, you've saved me a lot of heartache. I was having big difficulties in getting different currencies to work with subdomains on a single template with the multi-site mod, the currency kept getting 'stuck' on the main domain. Your helpful tip was exactly what I needed. Wish I had found it sooner.

Thank you

Simon

Simon

26 Jan 2015, 10:32 PM
#5
time111 avatar

time111

New Zenner

Join Date:
Sep 2008
Posts:
95
Plugin Contributions:
0

Re: Force display of other currency than default?

niccol:

Well, you need to set the variable $_SESSION['currency'] to the right value.

So basically you need to have GBP and EURO enabled. THis would normally mean that the user could choose between the two. When they choose it sets $_SESSION['currency']. Instead of letting them choose you force that variable to be what you want.

If that is all greek to you just add this line

$_SESSION['currency'] = 'EUR';

> 
> At the bottom of the file includes/init_includes/init_currencies.php.  It needs to go just above the '?>' at the end of the file.
> 
> And you need to check that you have euros enabled.

Hi,

This thing actually work but if I implement this, it is restricting the user to change to any other currency even if it is available in currency drop down menu. It just refuse to change.

Can anyone please suggest on how to manage non default currency on website but at the same time customers can still change if they want some other currency to show.

Thanking you in advance.

~Time
zen cart 1.5.4
27 Jan 2015, 7:37 AM
#6
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Force display of other currency than default?

Try changing this line:

// If no currency is set, use appropriate default
if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = DEFAULT_CURRENCY;

to this:

// If no currency is set, use appropriate default
if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = 'EUR';

And getting rid of the other edit. Probably a better solution.

time111:

Hi,

This thing actually work but if I implement this, it is restricting the user to change to any other currency even if it is available in currency drop down menu. It just refuse to change.

Can anyone please suggest on how to manage non default currency on website but at the same time customers can still change if they want some other currency to show.

Thanking you in advance.

~Time
zen cart 1.5.4

Nick
iszent.com

27 Jan 2015, 10:38 AM
#7
time111 avatar

time111

New Zenner

Join Date:
Sep 2008
Posts:
95
Plugin Contributions:
0

Re: Force display of other currency than default?

niccol:

Try changing this line:

// If no currency is set, use appropriate default
if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = DEFAULT_CURRENCY;

> 
> to this:
> 
> ```
// If no currency is set, use appropriate default
if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = 'EUR';

And getting rid of the other edit. Probably a better solution.

Hi,

This was the first thing I tried, its given in other forum post but it failed to do any changes then I tried this post edit, it works but it stick to given value and no change possible thereafter on front-end.

Any other suggestion?

~Time
zen cart 1.5.4

27 Jan 2015, 3:30 PM
#8
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Force display of other currency than default?

What is your setting in:

admin>>My Store>> Switch To Default Language Currency

After that check that you have removed the edit at the end of the file. If none of that works then you are going to have to post a URL so people can at least have a look.

time111:

Hi,

This was the first thing I tried, its given in other forum post but it failed to do any changes then I tried this post edit, it works but it stick to given value and no change possible thereafter on front-end.

Any other suggestion?

~Time
zen cart 1.5.4

Nick
iszent.com

28 Jan 2015, 3:44 AM
#9
time111 avatar

time111

New Zenner

Join Date:
Sep 2008
Posts:
95
Plugin Contributions:
0

Re: Force display of other currency than default?

Hi,

admin>>My Store>> Switch To Default Language Currency is False, changed to True but still make no difference.

Thanks for your effort and time, will think of some alternate approach later.

~Time

21 Aug 2015, 6:59 AM
#10
sonarscope avatar

sonarscope

New Zenner

Join Date:
Nov 2004
Location:
Varazdin Croatia
Posts:
74
Plugin Contributions:
0

Re: Force display of other currency than default?

time111:

Hi,

admin>>My Store>> Switch To Default Language Currency is False, changed to True but still make no difference.

Thanks for your effort and time, will think of some alternate approach later.

~Time
hi do You find solution to Force display of other currency than default and have working user currency drop down menu ?

thanx

best
emil

21 Aug 2015, 2:56 PM
#11
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Force display of other currency than default?

SonarScope:

hi do You find solution to Force display of other currency than default and have working user currency drop down menu ?

thanx

best
emil

Have you tried doing any of the recommendations?

Nick
iszent.com

22 Aug 2015, 8:00 AM
#12
sonarscope avatar

sonarscope

New Zenner

Join Date:
Nov 2004
Location:
Varazdin Croatia
Posts:
74
Plugin Contributions:
0

Re: Force display of other currency than default?

niccol:

Have you tried doing any of the recommendations?

hi Niccool

i tray admin>>My Store>> Switch To Default Language Currency
Croatian Language is default and pair with Croatian Kuna
and is not working

22 Aug 2015, 8:31 AM
#13
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Force display of other currency than default?

SonarScope:

hi Niccool

i tray admin>>My Store>> Switch To Default Language Currency
Croatian Language is default and pair with Croatian Kuna
and is not working

And have you tried this:

Quote Originally Posted by niccol View Post
Try changing this line:

// If no currency is set, use appropriate default
if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = DEFAULT_CURRENCY;

to this:

// If no currency is set, use appropriate default
if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = 'EUR';

And getting rid of the other edit. Probably a better solution.

Nick
iszent.com

22 Aug 2015, 10:54 AM
#14
sonarscope avatar

sonarscope

New Zenner

Join Date:
Nov 2004
Location:
Varazdin Croatia
Posts:
74
Plugin Contributions:
0

Re: Force display of other currency than default?

niccol:

And have you tried this:

Quote Originally Posted by niccol View Post
Try changing this line:

// If no currency is set, use appropriate default
if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = DEFAULT_CURRENCY;

> to this:
> 
> 
> ```
// If no currency is set, use appropriate default
if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = 'EUR';

And getting rid of the other edit. Probably a better solution.

thanks a lot Niccol,

I think this is woking now
i am going to do additional tests
i have some problem with Paypal Express shortcut button and i hope this change is not going to affect Paypal

emil