Skip to content

Commit 7b90fc5

Browse files
author
Taco van Sambeek
committed
9.1.7
1 parent 4958ed9 commit 7b90fc5

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
# Changelog #
44

5+
#### Changes in release 9.1.7
6+
+ Bugfix currency conversion when store default currency is different than admin default currency
7+
+ Small code cleanup
8+
59
#### Changes in release 9.1.6
610
+ Bugfix getting API key from settings table for OC version <3.x
711

catalog/controller/payment/mollie/base.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,11 @@ public function index()
195195
}
196196

197197
protected function convertCurrency($amount) {
198-
$currency = $this->session->data['currency'];
199-
$configCurrency = $this->config->get("config_currency");
200-
return $this->currency->convert($amount, $configCurrency, $currency);
198+
$currency = Util::load()->model("localisation/currency");
199+
$currencies = $currency->getCurrencies();
200+
$convertedAmount = $amount * $currencies[$this->session->data['currency']]['value'];
201+
202+
return $convertedAmount;
201203
}
202204

203205
//Format text
@@ -231,7 +233,6 @@ public function payment()
231233
$order = $this->getOpenCartOrder($order_id);
232234

233235
$currency = $this->session->data['currency'];
234-
$currency_value = $this->currency->getValue($this->session->data['currency']);
235236
$amount = $this->convertCurrency($order['total']);
236237
$description = str_replace("%", $order['order_id'], html_entity_decode($this->config->get(MollieHelper::getModuleCode() . "_ideal_description"), ENT_QUOTES, "UTF-8"));
237238
$return_url = $this->url->link("payment/mollie_" . static::MODULE_NAME . "/callback&order_id=" . $order['order_id'], "", "SSL");
@@ -315,9 +316,9 @@ public function payment()
315316
//Check if coupon applied
316317
if(isset($this->session->data['coupon'])) {
317318
//Get coupon data
318-
$this->load->model('extension/total/coupon');
319+
$coupon = Util::load()->model('extension/total/coupon');
319320

320-
$coupon_info = $this->model_extension_total_coupon->getCoupon($this->session->data['coupon']);
321+
$coupon_info = $coupon->getCoupon($this->session->data['coupon']);
321322

322323
if ($coupon_info) {
323324
$discount_total = 0;

catalog/controller/payment/mollie/helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class MollieHelper
77
{
8-
const PLUGIN_VERSION = "9.1.6";
8+
const PLUGIN_VERSION = "9.1.7";
99
const OUTH_URL = 'https://api.mollie.com/oauth2';
1010

1111
// All available modules. These should correspond to the Mollie_API_Object_Method constants.

0 commit comments

Comments
 (0)