hinteractive Posted July 14, 2015 Share Posted July 14, 2015 (edited) Hi, Somewhere after my store update to version 1.6.1 (not sure if this is related), I lost the ability to change the currency on the store. What I already did: 1. Changed theme to default; 2. Disabled overrides; 3. Cleared caches and cookies; 4. Uninstalled/Installed Currency Block. No results, so far. How far did I get: 1. On setCurrency() call, ajax call is returning 1... so I believe it's working that far. 2. The page is reloading, but the currency remains the same. What I believe it's happening: Cookie is not being set! In this function on ChangeCurrencyController.php, I believe something is not working (maybe the line before ajaxDie('1') where cookie is set): public function initContent() { $currency = new Currency((int)Tools::getValue('id_currency')); if (Validate::isLoadedObject($currency) && !$currency->deleted) { $this->context->cookie->id_currency = (int)$currency->id; $this->ajaxDie('1'); } $this->ajaxDie('0'); } There's a friend's computer where the cookies weren't cleared since the last updates, where this is working. I believe he has a cookie that is updated on currency change. If I delete his cookies I guess it will stop working. Or is this nonsense? Can someone give me a hand here? Can it be something else that has nothing to do with the cookies? Thanks, Edited July 14, 2015 by hinteractive (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted July 14, 2015 Share Posted July 14, 2015 it would be helpful to have the shop url. Link to comment Share on other sites More sharing options...
Muha Posted July 14, 2015 Share Posted July 14, 2015 Same issue here. Any help? Link to comment Share on other sites More sharing options...
hinteractive Posted July 15, 2015 Author Share Posted July 15, 2015 (edited) @El Patron: I'm afraid I can't post the URL yet. The site is still private and I don't have permission to post it. That's why I tried to be the most detailed as possible on my post. I can add that I didn't find anything in the Javascript Console, but I do have a couple of warnings that I believe to be unrelated: The "fb-root" div has not been created, auto-creating jquery-1.11.0.min.js:3 GET http://mydomain.com/themes/cws/css/images/bx_loader.gif 404 (Not Found) Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains. After deleting all the cookies, when I try to change currency, the site creates a cookie - however the currency doesn't change. When I retry to change the currency, the value in the cookie never changes. Unfortunately, the cookie value is encoded and unreadable. If there's any idea of something that I could try to solve this, it would be appreciated, thanks. Edited July 15, 2015 by hinteractive (see edit history) Link to comment Share on other sites More sharing options...
hinteractive Posted July 16, 2015 Author Share Posted July 16, 2015 I really need an answer on this problem, because the store can't go online without this feature. Can anyone guide to what I can do next? Thanks! Link to comment Share on other sites More sharing options...
Muha Posted July 16, 2015 Share Posted July 16, 2015 In my website suddenly it worked but only in Chrome browser, in IE I still have the issue. Any suggestions? Thanks. Link to comment Share on other sites More sharing options...
hinteractive Posted July 16, 2015 Author Share Posted July 16, 2015 After Muha's input, I decided to give it a try on IE, Opera, Firefox and Chrome. It's not working on none of them. Link to comment Share on other sites More sharing options...
Muha Posted July 17, 2015 Share Posted July 17, 2015 I think we both have done some change that produced this issue. I have made new installation with the same theme that I'm using and it doesn't have this issue. Any help? Link to comment Share on other sites More sharing options...
hinteractive Posted July 17, 2015 Author Share Posted July 17, 2015 Thanks for your input, Muha. I really didn't want to start all over, but if I have to, then I will. When I have the time I'll try a new installation and will carefully add things until I find what's going on. On an unrelated note, my pagination stopped working - it was loosing applied filters - because I removed the <b> tags on the buttons, which should be completely unrelated. I hope this is not something like that. Link to comment Share on other sites More sharing options...
hinteractive Posted July 17, 2015 Author Share Posted July 17, 2015 (edited) I managed to get it working. What was wrong? I have no idea! Here's what I did.... 1. New Prestashop installation with all defaults; 2. Added some currencies (currency change working); 3. Added my customized theme (currency change working); 4. Added overrides (currency change working); 5. Updated the new database with an SQL dump I made from the old installation (currency change working). What happened for it to stop working on the old instalation? Probably, the Prestashop upgrade messed up something! In the process I also lost some CSS styling, which is weird. It's very frustrating because you're building a web site and you think "ok, this is taken care of", but later down the road you have stuff that was working fine, suddenly gone to hell with no apparent reason! So I spent hours chasing "gambusinos". ("Gambusinos" is a portuguese word that represents something that doesn't exist) @Muha: I guess you'll have to do the same - new installation. Be careful not lose stuff, specially uploaded images - make a full backup of your site. Thanks for your help. Best of luck! This is not working yet! Edited July 17, 2015 by hinteractive (see edit history) Link to comment Share on other sites More sharing options...
hinteractive Posted July 17, 2015 Author Share Posted July 17, 2015 No no no no.... Not working yet! After all this work, can't change currency again. Could it be the cache? I don't have a clue! Can anyone help? I've tried all kind of things and no one came up with an helping hand, yet! Link to comment Share on other sites More sharing options...
Muha Posted July 17, 2015 Share Posted July 17, 2015 I have just hired someone professional to look up the issue. When I know something I will let you know. Regards, Link to comment Share on other sites More sharing options...
Muha Posted July 18, 2015 Share Posted July 18, 2015 He had fixed it. It was a javascript code in this file: themes/yourtheme/modules/blockcurrencies/blockcurrencies.tpl By the way which theme are you using? 1 Link to comment Share on other sites More sharing options...
hinteractive Posted July 20, 2015 Author Share Posted July 20, 2015 (edited) @Muha: Thanks for your input. Unfortunately my problem wasn't in there. I'm using the default template, that I customized to my needs. But I finally found out what the problem was: You can't have the option "Set default country from browser language" turned to "Yes" on the backoffice. When you choose a different currency, the cookie is set for the new currency, but after that, the browser language is detected and Prestashop resets the cookie for the currency of that language. I consider this a bug, because I might be in France but want to pay in pounds and it's impossible. Turning on the language detection is a nice customer service, but ultimately, the customer must be able to change his settings. Well, for now it's working, it's just a shame that I had to spend so much time to figure it out. Edited July 22, 2015 by hinteractive (see edit history) Link to comment Share on other sites More sharing options...
RemRim Posted July 22, 2015 Share Posted July 22, 2015 I've noticed that one can change currency in checkout page and after that currency is changeable in all other pages too. Link to comment Share on other sites More sharing options...
tivicrdotcom Posted October 17, 2015 Share Posted October 17, 2015 Hi guys, I was experiencing a similar problem where I could create a new currency but wasn't being saved, not even modifying the default one was doing anything until I turned the default country from browser language to NO. And this solved the issue, I was then able to create and modify currencies. Link to comment Share on other sites More sharing options...
matracon Posted October 21, 2015 Share Posted October 21, 2015 In my case the problem was detected change in location -> Location Settings, then turn off Set the default browser language from the country and solved! En mi caso el problema lo detecte cambiando en localización -> localización luego en configuración desactivar la opción Establece el país predeterminado desde el idioma del navegador y solucionado! Link to comment Share on other sites More sharing options...
amerigeau Posted January 12, 2016 Share Posted January 12, 2016 Hello everybody ! I have read a lot of forum posts about this "bug" so I have written a short tutorial : Debug : currencies not change with PrestaShop. And the image from the post to illustrate it below. Hope it would help Link to comment Share on other sites More sharing options...
bakh Posted March 6, 2016 Share Posted March 6, 2016 Hello I have read all the above discussion, but my problem is still not solved. See ginbaba.com the currencies cannot be changed can anyone please help ? Link to comment Share on other sites More sharing options...
MultiSJK Posted August 5, 2016 Share Posted August 5, 2016 same issue. tried all suggestions, no changecycleafrique.com Link to comment Share on other sites More sharing options...
MultiSJK Posted August 11, 2016 Share Posted August 11, 2016 open config.inc.php find these lines if (defined('APS')) { $cookie->id_currency = Configuration::get('PS_CURRENCY_DEFAULT'); } add // as below //if (defined('APS')) { //$cookie->id_currency = Configuration::get('PS_CURRENCY_DEFAULT'); //} adding the // in the lines above solved my issue Link to comment Share on other sites More sharing options...
hasbender Posted August 15, 2016 Share Posted August 15, 2016 Different fix: https://www.prestashop.com/forums/topic/507714-changing-currency-does-not-save-new-currency/?p=2385369 Link to comment Share on other sites More sharing options...
Recommended Posts