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
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
Last edited by testie on Wed Mar 14, 2018 7:11 am, edited 1 time in total.
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
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
This was a total shot in the dark but it worked, can't tell you how happy I am
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
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'));
}
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
---
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
---
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
This solution works great but right now it redirects all links with "?currency=" in the end to "index.php?route=common/home" after the currency is changed.
If I wanted to redirect the link in this way,
home.xyz/category-seo-link/product-seo-link/?currency=USD
to change the currency to USD and then go to
home.xyz/category-seo-link/product-seo-link/ how would I go about doing that?
I'm guessing i'd have to change the line
but to what?
If I wanted to redirect the link in this way,
home.xyz/category-seo-link/product-seo-link/?currency=USD
to change the currency to USD and then go to
home.xyz/category-seo-link/product-seo-link/ how would I go about doing that?
I'm guessing i'd have to change the line
Code: Select all
$this->response->redirect($this->url->link('common/home'));
Just add this:
before this:
in catalog/controller/startup/startup.php
no need for redirections.
Code: Select all
if (isset($this->request->get['currency']) && array_key_exists($this->request->get['currency'],$currencies)) {
$code = $this->request->get['currency'];
$this->session->data['currency'] = $code;
}
before this:
Code: Select all
if (!isset($this->request->cookie['currency']) || $this->request->cookie['currency'] != $code) {
setcookie('currency', $code, time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
}
in catalog/controller/startup/startup.php
no need for redirections.
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.
This worked even better than the change to the language file.
Is it possible to combine this method with something else, like also changing the country that is chosen by default in the cart during shipping estimation (changing the country_id, zone_id, iso_code_3, or something else), so that the currency and the delivery country can be changed together?
Is it possible to combine this method with something else, like also changing the country that is chosen by default in the cart during shipping estimation (changing the country_id, zone_id, iso_code_3, or something else), so that the currency and the delivery country can be changed together?
letxobnav wrote: ↑Wed Sep 18, 2019 10:02 amJust add this:before this:Code: Select all
if (isset($this->request->get['currency']) && array_key_exists($this->request->get['currency'],$currencies)) { $code = $this->request->get['currency']; $this->session->data['currency'] = $code; }
in catalog/controller/startup/startup.phpCode: Select all
if (!isset($this->request->cookie['currency']) || $this->request->cookie['currency'] != $code) { setcookie('currency', $code, time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']); }
Who is online
Users browsing this forum: Bing [Bot], openalvin, SelfSus, softmonke, systemmaker, tilly and 521 guests