From b77d26da0f80b259a6d01d0dceb3be5461e66893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihael=20Magdi=C4=87?= Date: Wed, 4 Mar 2026 14:43:34 +0100 Subject: [PATCH] Fix for MPC discounted, bad if statement --- .gitignore | 3 ++- b2bpayments.php | 2 ++ views/templates/hook/mpc.tpl | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0f2fe10..7fa0b0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ llmdumper.php -.llmdump \ No newline at end of file +.llmdump +.DS_Store \ No newline at end of file diff --git a/b2bpayments.php b/b2bpayments.php index 8537a70..cbe1751 100644 --- a/b2bpayments.php +++ b/b2bpayments.php @@ -396,6 +396,8 @@ class B2BPayments extends PaymentModule implements PrestaShop\PrestaShop\Core\Mo $id_product = (int)$embeddedProductAttributes['id_product']; $prices = $this->calculateMPC($id_product, $id_product_attribute); $this->smarty->assign([ + 'mpc_old_float' => $prices['old_price'], + 'mpc_new_float' => $prices['new_price'], 'mpc_old' => $this->context->getCurrentLocale()->formatPrice($prices['old_price'], $this->context->currency->iso_code), 'mpc_new' => $this->context->getCurrentLocale()->formatPrice($prices['new_price'], $this->context->currency->iso_code) ]); diff --git a/views/templates/hook/mpc.tpl b/views/templates/hook/mpc.tpl index 43d7676..f5ffc45 100644 --- a/views/templates/hook/mpc.tpl +++ b/views/templates/hook/mpc.tpl @@ -1,8 +1,8 @@ -{if isset($mpc_new) && $mpc_new > 0} +{if isset($mpc_new_float) && $mpc_new_float > 0}
MPC: - {if isset($mpc_old) && $mpc_old > $mpc_new} + {if isset($mpc_old_float) && $mpc_old_float > $mpc_new_float} {$mpc_old} {/if}