Hi,
Is there a way to remove/disable currency cookie in Opencart because my store has only 1 currency and this is obsolete?
Thanks!
OC version: 3.0.2.0
Theme made by: Zemez.io
Is there a way to remove/disable currency cookie in Opencart because my store has only 1 currency and this is obsolete?
Thanks!
OC version: 3.0.2.0
Theme made by: Zemez.io
Last edited by radi8tor on Fri Mar 01, 2019 1:33 am, edited 1 time in total.
Not sure what you mean by obsolete but it shouldn't do any difference whether it's one currency or multiple currencies being tracked on a store …
In your catalog/controller/startup/startup.php file,
find:
replace with:
This should provide what you need but I don't see the purpose on this one.
In your catalog/controller/startup/startup.php file,
find:
Code: Select all
if (!isset($this->request->cookie['currency']) || $this->request->cookie['currency'] != $code) {
Code: Select all
if (!isset($this->request->cookie['currency']) || (($this->request->cookie['currency'] != $code) && sizeof($currencies) > 1)) {
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I just want to add in that some parts of OpenCart --- and certainly some extensions --- rely on that cookie, so removing it may cause you issues. You're safer to just leave it alone, but if it matters to you a lot, straightlight's edit should work to make sure it's not set when first loading the store.
I,too, find this currency cookie annoying. I have my default currency set to GBP but it always displays USD in my shop. Most posts I've read suggest deleting the cookie and then it will reset itself when the site is loaded again. That's fine, but ........................ the latest versions of Firefox don't allow you to delete a single cookie, the only option available is to delete ALL cookies for that domain, which means a lot of time wasted logging back into non-OpenCart related parts of your site.
currency is set just like language in order:
language:
1) if it it set in the session
2) if it is set in the cookie
3) language based on browser accept, if you support those languages
4) your default language
currency:
1) if it it set in the session
2) if it is set in the cookie
3) your default currency
when changing language or currencies, it is set in the session and the cookie.
if your browser displays USD while your default currency is GBP, then you have set that USD currency when last visiting your site as that would be in the cookie.
or you have some extension which changes the default currency based on language or ip.
language:
1) if it it set in the session
2) if it is set in the cookie
3) language based on browser accept, if you support those languages
4) your default language
currency:
1) if it it set in the session
2) if it is set in the cookie
3) your default currency
when changing language or currencies, it is set in the session and the cookie.
if your browser displays USD while your default currency is GBP, then you have set that USD currency when last visiting your site as that would be in the cookie.
or you have some extension which changes the default currency based on language or ip.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Who is online
Users browsing this forum: daniil_oc, pprmkr, WaxedPerfection and 465 guests