Post by radi8tor » Mon Feb 25, 2019 10:30 pm

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
Last edited by radi8tor on Fri Mar 01, 2019 1:33 am, edited 1 time in total.

New member

Posts

Joined
Thu Feb 01, 2018 6:21 pm

Post by straightlight » Mon Feb 25, 2019 11:22 pm

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:

Code: Select all

if (!isset($this->request->cookie['currency']) || $this->request->cookie['currency'] != $code) {
replace with:

Code: Select all

if (!isset($this->request->cookie['currency']) || (($this->request->cookie['currency'] != $code) && sizeof($currencies) > 1)) {
This should provide what you need but I don't see the purpose on this one.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com contractor officials representative


Administrator

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by paulfeakins » Tue Feb 26, 2019 7:02 pm

radi8tor wrote:
Mon Feb 25, 2019 10:30 pm
Is there a way to remove/disable currency cookie in Opencart
Why?

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by Johnathan » Tue Feb 26, 2019 9:47 pm

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.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by radi8tor » Fri Mar 01, 2019 1:33 am

Thanks everybody for your input on this. I will consider not to remove the currency cookie.

New member

Posts

Joined
Thu Feb 01, 2018 6:21 pm
Who is online

Users browsing this forum: Baidu [Spider] and 24 guests