Page 1 of 1

Change Currency Via URL? [SOLVED]

Posted: Wed Feb 14, 2018 12:14 am
by testie
I used to be able to change currency through URL.

Example: http://opencart/?currency=USD

But it seems like this was removed in an update? I would greatly appreciate if there was an fix for this :) I found one extension for this but it's for an older version of Opencart.

My site is: http://bersau.se

Running Version 3.0.2.0

Re: Change Currency Via URL?

Posted: Wed Feb 21, 2018 9:39 pm
by testie
Bump ;)

Re: Change Currency Via URL?

Posted: Wed Feb 21, 2018 10:17 pm
by uksitebuilder
Not an option in OC default unless you have or had an extension that did this for you.

Re: Change Currency Via URL?

Posted: Sun Mar 11, 2018 7:16 am
by testie
Hm I'm pretty sure I have all extensions that I used on previous version of OC. And I find a lot of posts on the forum when people are suggesting the /?currency= trick. And I can't find any extension for it for 3.0.2.0

I found a post where you uploaded a .xml fix for this but I can't install it, probably because it's and old version :)?
viewtopic.php?t=181974

Re: Change Currency Via URL? [SOLVED]

Posted: Wed Mar 14, 2018 7:18 am
by testie
This was a total shot in the dark but it worked, can't tell you how happy I am :P

Found this post how to change language via URL:
viewtopic.php?f=190&t=143696#p556676

And just switched the lang & language attributes to "currency" and it worked!

So here is the solution for you who might stumble upon this post if you need to solve this problem:

Insert code below after the line 4 in the file catalog\controller\common\language.php

Code: Select all

if (isset($this->request->get['currency'])) {
 
    $this->session->data['currency'] = $this->request->get['currency'];
 
    $this->response->redirect($this->url->link('common/home'));
}

Re: Change Currency Via URL? [SOLVED]

Posted: Wed Mar 14, 2018 11:48 am
by IP_CAM
Well done, and it saved me from looking around for this again,
after I've installed it in a TestShop, but many Moon's ago...
I now installed both Routines, because one never know's,
it may one day be of use ... ;)
Thanks, Ernie
---
Image