Post by waqaraq » Wed Sep 15, 2021 6:38 pm

Hi.
I have two currencies on my Opencart 3.0.3.8. USD and EUR
USD is default currency
EUR is added with a conversion value
I want to be able to access the value of EUR programmatically in my Payment gateway plugin file at

Code: Select all

root/catalog/controller/extension/payment/xyz.php
Something like this:
"EUR"->Currency_Value
Please note that US is my default currency and I want to get the value of EUR without switching to EUR at the top left corner. Thanks

Newbie

Posts

Joined
Mon Jul 26, 2021 6:50 pm

Post by Gergely » Wed Sep 15, 2021 10:34 pm

Hi waqaraq,

Have you tried

Code: Select all

$this->currency->convert($value, $from, $to)
from system/library/cart/currency?

Active Member

Posts

Joined
Wed Sep 30, 2020 7:58 pm

Post by straightlight » Wed Sep 15, 2021 10:37 pm

OC version.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by xxvirusxx » Thu Sep 16, 2021 1:19 am

straightlight wrote:
Wed Sep 15, 2021 10:37 pm
OC version.
waqaraq wrote:
Wed Sep 15, 2021 6:38 pm
I have two currencies on my Opencart 3.0.3.8. USD and EUR

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by straightlight » Thu Sep 16, 2021 1:21 am

xxvirusxx wrote:
Thu Sep 16, 2021 1:19 am
straightlight wrote:
Wed Sep 15, 2021 10:37 pm
OC version.
waqaraq wrote:
Wed Sep 15, 2021 6:38 pm
I have two currencies on my Opencart 3.0.3.8. USD and EUR
Must of been edited right before I posted this.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Users browsing this forum: Google [Bot] and 264 guests