diff --git a/monei.php b/monei.php index 743cedd..db253fb 100644 --- a/monei.php +++ b/monei.php @@ -1768,12 +1768,16 @@ public function hookDisplayPaymentByBinaries($params) } if ($paymentMethodsToDisplay) { + $orderTotal = $this->context->cart->getOrderTotal(); + $this->context->smarty->assign([ 'paymentMethodsToDisplay' => $paymentMethodsToDisplay, 'moneiAccountId' => $this->moneiAccountId, - 'moneiAmount' => Tools::displayPrice($this->context->cart->getOrderTotal()), + 'moneiAmount' => $this->getCartAmount(), + 'moneiAmountFormatted' => Tools::displayPrice($this->getCartAmount()), 'moneiCreatePaymentUrlController' => $this->context->link->getModuleLink('monei', 'createPayment'), 'moneiToken' => Tools::getToken(false), + 'moneiCurrency' => $this->context->currency->iso_code, ]); return $this->fetch('module:monei/views/templates/hook/displayPaymentByBinaries.tpl'); diff --git a/views/templates/hook/displayPaymentByBinaries.tpl b/views/templates/hook/displayPaymentByBinaries.tpl index aa22af6..d832b0c 100644 --- a/views/templates/hook/displayPaymentByBinaries.tpl +++ b/views/templates/hook/displayPaymentByBinaries.tpl @@ -2,6 +2,8 @@ const moneiAccountId = '{$moneiAccountId|escape:'htmlall':'UTF-8'}'; const moneiCreatePaymentUrlController = '{$moneiCreatePaymentUrlController|escape:'htmlall':'UTF-8'}'; const moneiToken = '{$moneiToken|escape:'htmlall':'UTF-8'}'; + const moneiCurrency = '{$moneiCurrency|escape:'htmlall':'UTF-8'}'; + const moneiAmount = {$moneiAmount|intval}; {literal} var moneiTokenHandler = async (parameters = {}) => { @@ -144,7 +146,7 @@ {if $paymentOptionName eq 'monei-card'} {/if} @@ -254,50 +256,66 @@ {elseif $paymentOptionName eq 'monei-googlePay'} {literal} {/literal} {elseif $paymentOptionName eq 'monei-applePay'} {literal} {/literal}