Jump to content

Changing Currency Does Not Save New Currency


govindbaker

Recommended Posts

Hi,

 

I have a new site that we are trying to finish off.

http://austinracing.shopcreator.com/index.php?id_product=16&controller=product

 

Unfortunately there appears to be an issue with changing currencies.

I have set up 2 currencies. USD and GBP.

 

When I change to USD the ajax request is made and appears to pass through what is expected.

 

Then it reloads the product page but when it does it has not changed the currency.

 

I have checked and it appears to change the encrypted cookie value in my browser but the currency is still in pounds.

 

I have changed the setting to get currency/country from browser settings to off as has been suggested elsewhere but this makes no difference.

 

I have gone into the ChangeCurrencyController and checks that it gets there and outputted the $this->context->cookie->id_currency which is showing as changed (14 USD). But when I output the same value in the init of the product controller it is showing as 2 (GBP).

 

Any ideas why the cookie might be being overridden when the page reloads back to the default currency.

 

Any help would be much appreciated.

 

Thanks,

 

Govind

Link to comment
Share on other sites

Hi Govind welcome to PrestaShop,  great  looking shop.

 

I've seen this issue and it seems related often to the back office-->localization-->localization

 

Where it says Set default country from browser language

 

Disable and retest

Thanks for your response but as stated I have already changed this setting and it has made no difference

Link to comment
Share on other sites

  • 5 months later...

Similiar problem happened to me without any direct clues, perhaps upgrade to newer jQuery broke it. I had modified Tools.js setCurrency function as:

 

 
function setCurrency(id_currency)
{
$.ajax({
method: 'POST',
headers: { "cache-control": "no-cache" },
url: baseDir + 'index.php' + '?controller=change-currency&id_currency='+parseInt(id_currency),
success: function(msg)
{
location.reload(true);
}
});
}
 
and now block currency is again working.
Edited by hasbender (see edit history)
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...