Hi.
In some point of the checkout process I need to manually (via php code) trigger a currency change of the ammounts. Let's say the user chooses to use EUROS but to complete the order I need to convert everything to USD.
Wich will be the best way to do that? Can I call some function in the Currency Module to do this?
Thanks.
In some point of the checkout process I need to manually (via php code) trigger a currency change of the ammounts. Let's say the user chooses to use EUROS but to complete the order I need to convert everything to USD.
Wich will be the best way to do that? Can I call some function in the Currency Module to do this?
Thanks.
Last edited by i2Paq on Thu Aug 19, 2010 3:07 am, edited 1 time in total.
Reason: Topic moved
Reason: Topic moved
I've added that step into all my payment modules to convert it automatically so that the page doesn't have to change. But if you want to actually trigger the change on the page for modules that don't have currency support, you can:
If using 1.4.x:
1. EDIT:
catalog/controller/checkout/confirm.php <--normal checkout
and
catalog/controller/checkout/guest_step_3.php <-- guest checkout
2. FIND:
3. BEFORE, ADD:
if using 1.5.x/2.x:
1. EDIT: catalog/controller/checkout/checkout.php
2. FIND:
3. AFTER, ADD:
That will force the site to always change to USD when it hits the confirm page
If using 1.4.x:
1. EDIT:
catalog/controller/checkout/confirm.php <--normal checkout
and
catalog/controller/checkout/guest_step_3.php <-- guest checkout
2. FIND:
Code: Select all
$total_data = array();
Code: Select all
$this->currency->set('USD');
if using 1.5.x/2.x:
1. EDIT: catalog/controller/checkout/checkout.php
2. FIND:
Code: Select all
public function index() {
Code: Select all
$this->currency->set('USD');
That will force the site to always change to USD when it hits the confirm page
I think it should be added before $total_data, $total, $taxes calculations made by total extensions:
i put it just after:
around line 57
i put it just after:
Code: Select all
if (!$json) {
Code: Select all
$this->currency->set($this->config->get('config_currency'));
Qphoria wrote:I've added that step into all my payment modules to convert it automatically so that the page doesn't have to change. But if you want to actually trigger the change on the page for modules that don't have currency support, you can:
If using 1.4.x:
1. EDIT:
catalog/controller/checkout/confirm.php <--normal checkout
and
catalog/controller/checkout/guest_step_3.php <-- guest checkout
2. FIND:3. BEFORE, ADD:Code: Select all
$total_data = array();
Code: Select all
$this->currency->set('USD');
if using 1.5.x:
1. EDIT: catalog/controller/checkout/checkout.php
2. FIND:3. AFTER, ADD:Code: Select all
$this->language->load('checkout/checkout');
Code: Select all
$this->currency->set('USD');
That will force the site to always change to USD when it hits the confirm page
works great thank you
Opencart Version 1.5.5.1
i know this is an old thread, but i have just had to go through this,
and thought info may be handy for anyone
but when you force paypal to accept your default currency (your currency)
paypal then displays their conversion aswell to customer which is what customer pays (their currency)
(as really you pass on paypals crap conversion rate to the customer)
but this may be different to what customer was shown when viewing website
to get around this i add 3% on website conversion to cover any difference
so when they see conversion on paypal it should be same or lower than your conversion displayed on site
see
http://forum.opencart.com/viewtopic.php?f=19&t=102948
and thought info may be handy for anyone
but when you force paypal to accept your default currency (your currency)
paypal then displays their conversion aswell to customer which is what customer pays (their currency)
(as really you pass on paypals crap conversion rate to the customer)
but this may be different to what customer was shown when viewing website
to get around this i add 3% on website conversion to cover any difference
so when they see conversion on paypal it should be same or lower than your conversion displayed on site
see
http://forum.opencart.com/viewtopic.php?f=19&t=102948
Code: Select all
$this->currency->set('USD');
Does anybody know another way to force your currency?
All my extensions: Click here or Click here
Nevermind I figured it out.
For Opencart 2.3.x you can use this:
Replace EUR with the currency you want it to be.
For Opencart 2.3.x you can use this:
Code: Select all
$this->session->data['currency'] = 'EUR';
All my extensions: Click here or Click here
Reptile wrote:Nevermind I figured it out.
For Opencart 2.3.x you can use this:
Replace EUR with the currency you want it to be.Code: Select all
$this->session->data['currency'] = 'EUR';
This will turn whole website to EUR :/
malshan wrote:Reptile wrote:Nevermind I figured it out.
For Opencart 2.3.x you can use this:
Replace EUR with the currency you want it to be.Code: Select all
$this->session->data['currency'] = 'EUR';
This will turn whole website to EUR :/
No only at the checkout.
And you can easily switch back on the website using the currency switcher.
All my extensions: Click here or Click here
Hi,Qphoria wrote: ↑Tue Dec 01, 2009 5:19 amI've added that step into all my payment modules to convert it automatically so that the page doesn't have to change. But if you want to actually trigger the change on the page for modules that don't have currency support, you can:
If using 1.4.x:
1. EDIT:
catalog/controller/checkout/confirm.php <--normal checkout
and
catalog/controller/checkout/guest_step_3.php <-- guest checkout
2. FIND:3. BEFORE, ADD:Code: Select all
$total_data = array();
Code: Select all
$this->currency->set('USD');
if using 1.5.x/2.x:
1. EDIT: catalog/controller/checkout/checkout.php
2. FIND:3. AFTER, ADD:Code: Select all
public function index() {
Code: Select all
$this->currency->set('USD');
That will force the site to always change to USD when it hits the confirm page
Will this setting work with Journal 2 Theme?
This topic is quite old. Using an extension to handle auto-currency changes from the Marketplace should resolved the issue.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 43 guests