Post by FrontierVapor » Sun Jan 26, 2014 11:24 am

I am attempting to implement some cryptocurrency (bitcoin and dogecoin) on my opencart 1.5.5.1 site. I'm using the extension from this site: https://www.coinpayments.net/merchant-tools-plugins

I copied and modified this open source code: https://github.com/btcgear/Bitcoin_Exch ... e_OpenCart to allow my site to display prices in the currency I'm trying to implement (Dogecoin). Got it working, but I ran into trouble when I realized that if the user is displaying prices in Dogecoin Opencart attempts to pass the order total to coinpayments.net as a Doge value (which of course, it doesn't understand... it wants the value to be in USD).

As a workaround I took Qphoria's advice from this thread: http://forum.opencart.com/viewtopic.php ... ncy#p39245 and added

Code: Select all

$this->currency->set('USD');
into my checkout.php controller to force the site into USD mode during checkout.

My question is: How can I make opencart pass the value to coinpayments.net as a USD value while still allowing the user to view the checkout page in whatever currency they wish?

Any help would be greatly appreciated!

Newbie

Posts

Joined
Sun Jan 26, 2014 11:10 am

Post by FrontierVapor » Wed Jan 29, 2014 2:18 am

So, I've been puzzling over this problem for a couple of days and I think I'm maybe getting closer to understanding it...

In the coinpayments payment module controller PHP file I see the following line of code which seems responsible for passing the total:

Code: Select all

$total = $this->currency->format($order_info['total'], $order_info['currency_code'], false, false);
I'm thinking that it refers to a variable set in either the checkout.php controller or payment_method.php, but I'm a bit at a loss. I've tried moving Qphoria's code snippet into this file just above that code in order to force the variable to be pulled in USD, but that didn't seem to do anything. Anyone got any ideas?

Thanks!

Newbie

Posts

Joined
Sun Jan 26, 2014 11:10 am
Who is online

Users browsing this forum: No registered users and 17 guests